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

yes, you could set a User preference and fetch that one... we have used that in a scenario when users are ordering on behalf

 

Simon Christens
Kilo Sage

Well its rather interresting because it actually works on Serviceportal, but not in backend.
To it seems like an error in the system.

The way i worked around it was to use g_user instead of g_scratchpad.

g_user.holder = newValue;

g_user is also a global object and its available from the minute you log in 🙂

When your done (maybe in onSubmit client script) you can then remove the attribute from g_user with:
delete g_user.holder

This sounds promising!

Did you manage to get it working ?

Nope.  For whatever reason that second window that pops up when adding new MRVS entries is an entirely new window with no way back to the previous form object.

Without ServicePortal I can get it to work since window.parent works nicely.  But since that isn't an object in ServicePortal, I'm left with kicking rocks.

Even worse, I hear product management doesn't even consider this a weakness, and have no plans to enhance for this.  IN WHAT PARADIGM CAN LINE ITEMS ***NEVER*** USE PREFILLED ITEMS FROM THE FORM

find_real_file.png