The CreatorCon Call for Content is officially open! Get started here.

Run script not working in Workflow - but working in BACKGROUND SCRIPT

Jagadish Sanadi
Kilo Sage

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'

1 ACCEPTED SOLUTION

Jagadish Sanadi
Kilo Sage

Thank You for all your help.

 

Created scratchpad variables to save current.variable values and tried update. It worked

View solution in original post

6 REPLIES 6

AnveshKumar M
Tera Sage
Tera Sage

Hi @Jagadish Sanadi 

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 👍✔️

Thanks,
Anvesh

In Workflow I have above code

Anil Lande
Kilo Patron

Hi,

What type of variable it is on your catalog form?

 current.variables.product_catalog_item

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

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'