Event triggering twice through workflow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 04:27 AM
Hi Everyone,
Event triggering twice through workflow event is - eud.refresh.defer
var clientUtils = new SI();
var checkUser = current.assigned_to;
clientUtils.makeUserActive(checkUser);
gs.eventQueue('eud.refresh.defer', current, '', '');
Script:
akeUserActive: function(checkUser) {
var grActiveUser = new GlideRecord('sys_user');
grActiveUser.addEncodedQuery('u_cisco_active=true^active=false');
grActiveUser.addQuery('sys_id', checkUser);
grActiveUser.query();
if (grActiveUser.next()) {
grActiveUser.active = true;
grActiveUser.update();
}
},
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 04:30 AM
Does your workflow have current.update() ?
Any BR on the table has current.update()?
Or GlideRecord to update the record workflow is on?
-Anurag
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 10:18 PM - edited 02-06-2024 10:22 PM
No @Anurag Tripathi , no where is using current.update()
Script: IF activity
// This script needs to set answer to 'yes' or 'no' to indicate the state of the activity.
//
// For example,
//
answer = ifScript();
function ifScript() {
var asset_invitation_gr = new GlideRecord('u_asset_invitation_pause_cancel');
asset_invitation_gr.addQuery('u_asset', current.sys_id);
asset_invitation_gr.query();
if (asset_invitation_gr.next()) {
if (asset_invitation_gr.u_action == 'Pause') {
return 'yes';
}
if (asset_invitation_gr.u_action == 'Cancel') {
return 'no';
}
}
}