How to get the NAME of a sc_req_item variable via a business rule ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 09:04 AM
Hi,
I need to get the NAME of the variable of a requested item ... .
The BR runs on the sc_req_item table after insert ... but I'm not able to access the NAME of the variable.
If I WOULD have the name of the variable I could access it via gs.info(current.varriable.testvariable) what would show the VALUE of the Variabler (not the sys_id) ...
But what I need the the NAME of the variable that has been requested ... .
Currently it looks to me like I would have to check a bunch of tables like
sc_item_option_mtom > sc_item_option > item_option_new ... to finally getting the name of the variable ...
Is there not more easy way???

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 03:48 AM
This is not the issue!
I do not KNOW THE FIELD NAME! ... so
gs.log(current.variables[field]); ... WILL NOT WORK AS I DO NOT HAVE IT at this point in time... .
But is ok. No further help required on this a I somehow solved it otherwise ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2018 04:15 AM
gs.log(field); //gives you the variable name of each variables in loop
Here, field is not the field name.
it's just the temp variable used for for loop.
You don't need variable names to be known.
That's why I mentioned try it in server script.
Anyhow you have found the answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 10:53 AM
Use this alternative
g_form.setValue("variable_name", []);
Please check and let me know if still facing the issue.