How can you change the Class on an Asset Record from Asset to Hardware?

Teri Bobst
Mega Guru

We have several Hardware records that were incorrectly created under the base class: Assets. I need to move these to the Hardware Class but that field is not editable, even at an ADMIN level.

Does anyone know a way to change these records?

Dictionary Info: alm_asset.sys_class_name
Table
alm_asset
Field
sys_class_name
Type
sys_class_name
1 ACCEPTED SOLUTION

Rahul Shandily3
Giga Guru

You can write a background script and update the class value.

 

var gr = new GlideRecord("alm_asset");

gr.addQuery(Record sys ids or query to all those records which needs to be modified);

gr.query();

while(gr.next()){

gr.sys_class_name = "alm_hardware";

gr.update();

}

 

If the script works in Dev, move the code to Prod through a Fix Script. and Run it adhoc in Production.

 

Best Regards,

Rahul

Please mark Correct / Helpful if this resolved your query.

View solution in original post

1 REPLY 1

Rahul Shandily3
Giga Guru

You can write a background script and update the class value.

 

var gr = new GlideRecord("alm_asset");

gr.addQuery(Record sys ids or query to all those records which needs to be modified);

gr.query();

while(gr.next()){

gr.sys_class_name = "alm_hardware";

gr.update();

}

 

If the script works in Dev, move the code to Prod through a Fix Script. and Run it adhoc in Production.

 

Best Regards,

Rahul

Please mark Correct / Helpful if this resolved your query.