Server-side equivalent to g_scratchpad?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2012 07:44 AM
Is there a server-side equivalent to g_scratchpad?
What I'm try to accomplish is to build a List Choice UI Action that runs on the server (client not checked). I want to retain a unique identifier that will be used for each record that is checked to be processed.
For example, say I select four records in a list and choose my UI Action from the list choices. When the first record is processed I want to create a unique identifier and then use that unique identifier when all records are processed.
Any ideas or alternatives?
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2012 07:54 AM
You should be able to set a global variable that will persist for the duration of the transaction. Then just check for its existence before setting or using it.
e.g.,
if (typeof g_my_temporary_unique_global_variable_name == "undefined")
g_my_temporary_unique_global_variable_name = "some value I want to use";
current.u_custom_field = g_my_temporary_unique_global_variable_name;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2012 08:13 AM
Thanks for the quick reply.
I just tried this but I get an error ""g_my_temporary_unique_global_variable_name" is not defined". is there some additional initialization required?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2012 08:24 AM
Never mind, my mistake. I inadvertently left out your instruction to test for the global property's existence before using it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2012 08:26 AM
Strange, I don't get that. Are you sure you have the "typeof" bit of the IF statement in there? That's what protects against it not yet being defined...