Unable to pass the scratchpad values in onLoad client script

Sujatha V M
Kilo Patron
Kilo Patron

Hi Team, 

 

I would like to cascade the incident number to change request 'parent' field using onLoad client script. 

 

I have fetched the incident number using display BR and able to get the logs, but when trying to set the scratchpad value in onLoad client script its "blank". 


Sujatha8_0-1679422341445.png

 

I'm trying to pass the number field value to parent (reference) field on the change request form. 

 

Sujatha8_1-1679422275909.png

 

If I pass a sys id directly, it works but not the one from scratchpad. 

 

Please help!

 

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.
1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

The display BR triggers when the incident record is loaded, so you would need an onLoad client script on the same incident table to use the scratchpad value from the BR.  To get the incident number to a new change request record, you would have to look at the action which generates a new change record.  If you're using a UI Action, then the code to grab the incident number before going to the new change record needs to be in there...

View solution in original post

5 REPLIES 5

Brad Bowman
Kilo Patron
Kilo Patron

The display BR triggers when the incident record is loaded, so you would need an onLoad client script on the same incident table to use the scratchpad value from the BR.  To get the incident number to a new change request record, you would have to look at the action which generates a new change record.  If you're using a UI Action, then the code to grab the incident number before going to the new change record needs to be in there...

Prince Arora
Tera Sage
Tera Sage

@Sujatha V M ,

 

The g_scratchpad object used for passing information from the server to the client when the client requires information not available on a form. This can be accomplished by creating a business rule to put the information in the g_scratchpad object and accessing the information in a client script.

 

Both the business rule and client script should be on same table for g_scratchpad that's why we need to write display business rule which works when the form gets open, 

Please try with GlideAjax method for your case!

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

I'm having trouble to fetching the details. Could you please help me on it? As its in agent workspace, I tried to fetch via URL parameters also but its not working. 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

@Sujatha V M ,

 

Can you share how you are passing data via URL? Let me help you on that!