Can I set a g_scratchpad variable on a catalog client script for later use?

Uncle Rob
Kilo Patron

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?

17 REPLIES 17

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.

can you have a hidden variable with default value?

trying to brainstorm a bit

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. 😞

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!

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?