Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Event triggering twice through workflow

venugopal s
Tera Contributor

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

Anurag Tripathi
Mega Patron

Does your workflow have current.update() ?

Any BR on the table has current.update()?

Or GlideRecord to update the record workflow is on?

-Anurag

No @Anurag Tripathi , no where is using current.update()

venugopals_0-1707286650358.png

 

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';
        }
    }
}