- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2015 12:37 PM
In a workflow, I'm trying to copy a requested item variable value from one requested item to current in a run script. Both choice lists are identical, both variables are typed as "select box" with None. The result I get looks to set the value but not the display value. I've tried doing the setValue and setDisplayValue with no success. Anybody encountered this?
The code looks like:
gr = new GlideRecord('sc_req_item');
if (gr.get(ritm)) {
current.variables.u_solution = gr.variables.u_solution;
}
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2015 12:08 PM
Thanks. For this variable type, it didn't seem to do the complete job. The display was seemingly set, but the value was not stored on the form. I tried these possibilities below to introspect what was possible:
gs.log('WF==> gr.getDisplayValue->u_solution=' + gr.getDisplayValue('variables.u_solution'));
gs.log('WF==> gr.getValue->u_solution=' + gr.getValue('variables.u_solution'));
gs.log('WF==> gr.variables.u_solution=' + gr.variables.u_solution);
I got something intelligent back on the first and third methods. The third method wound up working for me on this select box (as posed as the original problem). I guess I must have had a typo along the way.
Thanks again for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2015 01:38 PM
Hi,
Try using the setDisplayValue with the below syntax. I experienced similar behavior and this syntax helped me in most situations.
gr.setDisplayValue('opened_at','2011-02-13 4:30:00');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2015 12:08 PM
Thanks. For this variable type, it didn't seem to do the complete job. The display was seemingly set, but the value was not stored on the form. I tried these possibilities below to introspect what was possible:
gs.log('WF==> gr.getDisplayValue->u_solution=' + gr.getDisplayValue('variables.u_solution'));
gs.log('WF==> gr.getValue->u_solution=' + gr.getValue('variables.u_solution'));
gs.log('WF==> gr.variables.u_solution=' + gr.variables.u_solution);
I got something intelligent back on the first and third methods. The third method wound up working for me on this select box (as posed as the original problem). I guess I must have had a typo along the way.
Thanks again for your help.