Update OOTB Asset-CI install status mapping

Nico12
Mega Sage

Hi,

 

On the asset-ci Install status mapping table, i have a requirement to deactivate or modified some of the records.

For exemple I need to set "In Transit" Asset State to "Active = false".

 

Capture d’écran 2022-11-29 à 16.40.34.png

 

I can't modify the fields as they are greyed out.

What is the best practice to proceed ?

 

Regards,

 

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

That is because there are two ACL:-

 

One which says the asset role user can update the record if Out of the box field is false:-

 

Saurav11_0-1669737562542.png

 

So the simple solution you may think is make the out of the box field as false and then edit it. But then the second ACL comes into play which says the out of the box field cannot be edited by anyone:-

 

Saurav11_1-1669737695689.png

 

So one way is to make the ACL false update the field and then make them true.

 

OR 

 

Use a background script/fix script with below code:-

 

var gr= new GlideRecord('alm_asset_ci_state_mapping');
gr.get('replacesysidoftherecord');
{
    gr.active=false;
    gr.update();
}

 

Please mark my answer as correct based on Impact.

View solution in original post

3 REPLIES 3

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

That is because there are two ACL:-

 

One which says the asset role user can update the record if Out of the box field is false:-

 

Saurav11_0-1669737562542.png

 

So the simple solution you may think is make the out of the box field as false and then edit it. But then the second ACL comes into play which says the out of the box field cannot be edited by anyone:-

 

Saurav11_1-1669737695689.png

 

So one way is to make the ACL false update the field and then make them true.

 

OR 

 

Use a background script/fix script with below code:-

 

var gr= new GlideRecord('alm_asset_ci_state_mapping');
gr.get('replacesysidoftherecord');
{
    gr.active=false;
    gr.update();
}

 

Please mark my answer as correct based on Impact.

Hello,

 

If my answer helped you can you also mark it as correct.

 

Thanks.

emir
ServiceNow Employee
ServiceNow Employee

The best is not to touch them, you will break some functionality down the road (like HAM) and it will be very difficult to troubleshoot later.