The Zurich release has arrived! Interested in new features and functionalities? Click here for more

We need to stop updating the computer records when the state is in retired state

suuriyas
Tera Contributor

HI Community,

 

I have a requirement, "Stop updating any attributes for the computers in disabled state to in retired OU"

We need to stop updating the computer records when the state is in retired state... we are using a robust transform map and the data is coming from AD so when the computers are in retired state then that particular records should not update / map.

 

Please let me know how we can write a condition for this.

6 REPLIES 6

Alok Gupta5
Tera Guru
Tera Guru

Hi,

Use Business Rules:
  • Business rules can be created to trigger specific actions based on certain conditions.
  • You can create a business rule that checks the status of a CI and prevents updates if it is set to "Retired".

HI @Alok Gupta5 ,

 

Thanks for replying 

I tried this but it didnot work

 

Created a Before BR with this condition and script 

condition : current.operational_status == '6'

script : 

(function executeRule(current, previous /*null when async*/) {

    if (current.operation() == "6" ) {
        gs.addErrorMessage('cannot update a retired record');
        current.setAbortAction(true);
        return;
    }

})(current, previous);
suuriyas_1-1754032147095.png

 

suuriyas_0-1754032088276.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@suuriyas 

if your transform map has "Run business rule" unchecked then your BR won't run.

why not handle this at the transform map level?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

HI @Ankur Bawiskar ,

 

Thanks for replying,

Can you please let me know how can we achieve this in Transform map without using BR