g_scratchpad

SoniShaily
Tera Contributor

Hey everyone,
I’m trying to use a value from g_scratchpad in a catalog client script, but it keeps coming back as undefined. I’ve set the scratchpad value in a Catalog Server Script on the same item.
Am I missing something?

1 ACCEPTED SOLUTION

Rushi Savarkar
Kilo Sage

Hello @SoniShaily 

Make sure your Catalog Client Script is running after the Catalog Server Script. g_scratchpad is only available on load.
Type = onLoad for the client script.

It won’t work in onChange or onSubmit unless you store the value in a variable.
Also, double-check that your server script is actually populating the value and that it's scoped to the right item or variable set.

Thank you!

If my response helped you, please accept the solution and mark it as helpful.
Thank You!

View solution in original post

5 REPLIES 5

Rushi Savarkar
Kilo Sage

Hello @SoniShaily 

Make sure your Catalog Client Script is running after the Catalog Server Script. g_scratchpad is only available on load.
Type = onLoad for the client script.

It won’t work in onChange or onSubmit unless you store the value in a variable.
Also, double-check that your server script is actually populating the value and that it's scoped to the right item or variable set.

Thank you!

If my response helped you, please accept the solution and mark it as helpful.
Thank You!