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-15-2019 12:20 AM
yes, you could set a User preference and fetch that one... we have used that in a scenario when users are ordering on behalf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 12:41 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 05:38 AM
This sounds promising!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 11:41 PM
Did you manage to get it working ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2019 08:03 AM
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