The CreatorCon Call for Content is officially open! Get started here.

concept on g_scratchpad

Rajkumar Bommal
Tera Contributor

Hi 
How would i Show Alert message on creating an incident record it should display the caller's location. By using g_scratchpad in BusinessRule and client script..

1 ACCEPTED SOLUTION

@Rajkumar Bommal - ah apologies, it was the caller's location not the current user.šŸ˜…

 

If so, you can update the BR to 

(function executeRule(current, previous /*null when async*/ ) {

    var userGr = new GlideRecord("sys_user"); 
    userGr.get(current.getValue('caller_id'));
    g_scratchpad.currentLocation = userGr.getDisplayValue('location');

})(current, previous);

View solution in original post

18 REPLIES 18

Pushpanjali
Tera Contributor

@Rajkumar Bommal 

 

g_scratchpad to do a one-time push of the information from the server when the form is loaded, and b) a GlideAjax call to have the client script call the server and the server return a result. Async GlideAjax is recommended!

 

mark if correct/helpful.

 

Regards,

Pushpanjali

Rajkumar Bommal
Tera Contributor

BusinessRule

RajkumarBommal_0-1711620843340.png

Client Script- onload

RajkumarBommal_1-1711620949404.png

 

 

Scripts look fine, can you share a screenshot of the current user's record with the location field?

Hi @Rajkumar Bommal 

can you use the below line and check once if it works for you.

g_scratchpad.currentLocation = userGr.location.name;

 

Thanks & Regards,

Anitha H V

@1__AnithaHV 
Thanks For the reply but it is also not working