
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 07:22 AM
Hello,
I have an order guide/catalog item that uses a variable set and the variables are cascaded. If someone changes a variable on an associated task I want to capture the change in the activity stream work note. How can I accomplish this?
Thanks,
Joe
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 01:04 PM
Can you test this once
var key;
for(key in current.variables){
if(current.variables[key] != previous.variables[key]){
current.work_notes = "Variable changed "+key + "Value Changed to"+current.variables[key];
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 08:17 AM
Thanks Joe for pointing it out 🙂
Let us know if you need more help.
I fixed the above code.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 09:33 AM
Ankur, this worked! When I change a variable in the task it shows "Variable Changed" in the work notes activity.
I have a few other questions regarding this.
1) Is there a way to configure this to all catalog items instead of specifying just 1?
2) Instead of just recording "Variable Changed" can I give more detail specifying what variable changed and what it changed from and to?
Thanks again for the help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 10:21 AM
Hi Joe
To make it work for all, don't add this && current.request_item.cat_item.name == 'Catalog Item Name here'
To make it work for all variables
Try something like this
for(var key in current.variables){
if(key in previous.variables){
if(current.variables[key] != previous.variables[key]){
current.work_notes = "KA variable"+key+"Change to"+current.variables[key];
}
}
}
Regards
Pranav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 12:19 PM
When I take out this part of the condition " && current.request_item.cat_item.name == 'Catalog Item Name here'" It does work for all catalog items.
but when I add the below script it stops working all together.
for(var key in current.variables){
if(key in previous.variables){
if(current.variables[key] != previous.variables[key]){
current.work_notes = "KA variable"+key+"Change to"+current.variables[key];
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 01:04 PM
Can you test this once
var key;
for(key in current.variables){
if(current.variables[key] != previous.variables[key]){
current.work_notes = "Variable changed "+key + "Value Changed to"+current.variables[key];
}
}