Can I set a g_scratchpad variable on a catalog client script for later use?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 10:20 AM
I have an onLoad client script that looks like... (onchange of remit_to variable)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_scratchpad.holder = newValue;
}
I can't alert g_scratchpad.holder though. Is g_scratchpad not meant to be used this way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 11:16 AM
For firetrucking sake. There's GOT to be a way to store a client side value for use when a multi-row-variable-set form loads.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 12:52 PM
can you have a hidden variable with default value?
trying to brainstorm a bit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 07:22 PM
The variable has to be passable between the main catalog item form and the from the MRVS opens on. Using that g_scratchpad variable was my last hope. 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 07:42 PM
Robert, when I get in this kind of bind I usually create a system property. I store the var in the property and retrieve when needed.
Client-side:
var rec = new GlideRecord('sys_properties');
rec.addQuery('name', 'your.property.name.here');
rec.query();
if(rec.next()){
var yourPropertyValue = rec.value;
}
Server-side:
var propertyValue = gs.getProperty('your.property.name.here');
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019 08:04 PM
Hmmm... so the context is a catalog item, yeah?
I'd be worried about what happens if two people are executing the same item at roughly the same time.
I wonder... can a personal preference be set?