Trying to copy picture field to icon field in sc_catalog_item table

Faizan Haider
Tera Contributor

i am trying to copy picture field to icon field in sc_catalog_item table.
i have written below script but it is not copying all the catalog item, some were left.

 

var picUpdate = new GlideRecord("sc_cat_item");
picUpdate.query();
while(picUpdate.next()){
var copy = picUpdate.getValue("picture");
picUpdate.icon = copy;
picUpdate.update();
}

 

suggest me something that i have to add in the script.

2 REPLIES 2

Clara Lemos
Mega Sage
Mega Sage

Hi @Faizan Haider ,

 

It could be worth verifying the value on the "checked out" field, if the value is true for this field you won't be able to modify it from your script. If that is the case, you'll need to go to the item and click on 'cancel check out'. 

 

If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know

Cheers

Faizan Haider
Tera Contributor

Hi @Clara Lemos ,

 

There is no workflow in that item.

Screenshot 2024-01-29 223445.jpg