- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2016 09:30 PM
Can someone help me an idea on how to trigger a record update in workflow?
I have a catalog with asset record fields, when this catalog item filled in and submitted approval workflow should trigger and after approved it should capture the changes from the catalog item fields and update the asset record?
Any suggestion on how can we achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2016 10:04 PM
I am not sure, whether there is an more easier way to know any of the "Properties" are updated or not, since you are comparing with another object. In fact, If there are no changes in fields, SNOW GlideRecord will not "Update" actually, though we call "update" function. Here is some sample code to do this.
In "Run script" component, you can write like below.
var updateRequired = false;
var variable1 = current.variable_pool.variable1;
var variable2 = current.variable_pool.variable2;
var assetid = current.variable_pool.assetid;
var grAsset = new GlideRecord('asset table');
if(grAsset.get(assetid))
{
var actualdata1 = grAsset.field1;
var actualdata2 = grAsset.field2;
if(actualdata1 != variable1 || actualdata2 != variable2)
updateRequired = true;
if(updateRequired == true)
{
grAsset.field1 = variable1;
grAsset.field2 = variable2;
grAsset.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 04:59 AM
Ahh..now i don't see the issue BUT select model is not appearing in variable editor in requested item it shows empty. Due to this i can't see the duplicate entries in maintain items.
In Variable editor i can't see the Model which i selected in catalog item.
Issue which was seen before is, whenever i used option to edit a model i can that product in the maintain item lists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 05:06 AM
Hi Ravi,
I don't quite understand this issue. I can see that, when "Select model" is clicked, its showing list of all models in pop-up page. Are you not able to see any records, when you click on "reference" icon? I guess, it might be with the user account you are using this to test. Check whether the user is admin or he has sufficient roles.
Thanks
Rami Reddy