12 Replies · Latest reply on Aug 12, 2017 9:59 PM by Jim Calhoun

    Inbound action to lock out and deactivate a user

      I have a inbound action that I just cannot get to work.  My target table is sys_user, I am trying to set Active = false and Locked_out = true.

      In the body of the email we have the following line of text "Employee ID: 12345678"  (the number after ID: is the user_name value)

      In the When to run section I have the type as "Forward" & from as me.

       

      Below is the script I am using.  Any help would be great

       

      var user = email.body.ID;

      if (user != undefined){

        var gr = new GlideRecord("sys_user");

        if(gr.get("ID:", user_name)){

        gr.active = false;

        gr.locked_out = true; 

        gr.update();

        }

      }