- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 09:54 PM - edited 12-12-2023 11:13 PM
Run script not working in Workflow - but working in BACKGROUND SCRIPT
var sys_id_maintain = current.variables.product_catalog_item;
var grAppIns = new GlideRecord('sc_cat_item');
grAppIns.addQuery('sys_id', sys_id_maintain);
grAppIns.query();
//update the catalog item with source values
while (grAppIns.next()) {
grAppIns.setValue('name', current.variables.description);
grAppIns.update();
}
Type of current.variables.description is 'HTML' and in sc_cat_item the type of variable for description is 'Translated HTML'
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 04:35 AM
Thank You for all your help.
Created scratchpad variables to save current.variable values and tried update. It worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:06 PM
You mean to say not working in Scheduled Job?
If yes, look at the current variable in your script.
Please mark my answer helpful and accept as a solution if it helped 👍✔️
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:09 PM
In Workflow I have above code

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:08 PM
Hi,
What type of variable it is on your catalog form?
current.variables.product_catalog_item
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:13 PM
var sys_id_maintain = current.variables.product_catalog_item;
var grAppIns = new GlideRecord('sc_cat_item');
grAppIns.addQuery('sys_id', sys_id_maintain);
grAppIns.query();
//update the catalog item with source values
while (grAppIns.next()) {
grAppIns.setValue('name', current.variables.description);
grAppIns.update();
}
Type of current.variables.description is 'HTML' and in sc_cat_item the type of variable for description is 'Translated HTML'