- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2022 08:18 AM
I have to update the variable value on ritm and task form using the background script. Could you please help me with that?
Variable backend name 'var_isInternational' and I need to set 'Yes or No' value using background script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2022 08:26 AM - edited ‎10-25-2022 08:32 AM
Hi @ak49
You can use below script:
try
{
var gr=new GlideRecord("sc_req_item");
gr.get("GIVE SYS_ID HERE");
gr.variables.var_isInternational="GIVE VALUE HERE"; //updated this line
gr.setWorkflow(false); //to stop BR's
gr.update();
}
catch(e)
{
gs.info("Error: "+e.message());
}
Hope it helps
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2022 08:26 AM - edited ‎10-25-2022 08:32 AM
Hi @ak49
You can use below script:
try
{
var gr=new GlideRecord("sc_req_item");
gr.get("GIVE SYS_ID HERE");
gr.variables.var_isInternational="GIVE VALUE HERE"; //updated this line
gr.setWorkflow(false); //to stop BR's
gr.update();
}
catch(e)
{
gs.info("Error: "+e.message());
}
Hope it helps
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2024 08:40 AM
Can you please share the code where we can update different old values with multiple new values. Something like
if RITM has 10 number should be updated with ABC or if RITM has 20 number it should be updated with XYZ values..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2022 08:27 AM
var ritm = new GlideRecord('sc_req_item');
ritm.get('sysIDofRITMyouWantToUpdate'); // Pass in the sys_id of the RITM
ritm.variables.var_isInternational = 'No'; // Or 'Yes' if you want to set to yes
ritm.update();