[Asset Management] Delete UI action on alm_hardware/asset table records is not working on few set of records after upgrade to Orlando


Description

After upgrade to Orlando, when we try to delete certain assets (that are created before Orlando upgrade and with CI attached) ​using the Global UI action "Delete" then nothing happens. Whereas the deletion of record from scripts-background works fine.​ And moreover, it looks like the assets created before the Orlando upgrade and the ones with CI are affected. Few symptoms looks as below:

1) The delete ui action does nothing on asset record.

2) If we try delete ui action from asset's related CI it works fine.

3) If we try to delete it from scripts - background it works fine.

4) On the asset form once you use Delete UI action you will find below in browser console:

""

Uncaught TypeError: Cannot read property 'split' of null 
at getCascadeDelTablesDoneForm 

""

5) If you try to look at the related node logs you will find below:

""

12:42:03.729 Warning Default-thread-1 B48A535A1BAC10508B63CAAE6E4BCB6E txid=461f539e1bac WARNING *** WARNING *** org.mozilla.javascript.EvaluatorException: GlideRecord.setTableName - empty table name (sys_script_include.bc010330c33310000f343b251eba8ffb.script; line 14) 
org.mozilla.javascript.JavaScriptException: org.mozilla.javascript.EvaluatorException: GlideRecord.setTableName - empty table name (sys_script_include.bc010330c33310000f343b251eba8ffb.script; line 14) 

""




Release or Environment

Assets created prior to Orlando release.

Cause

1) When we use the Delete ui action it makes a call to script include "DeleteRecordAjax"

2) This script include DeleteRecordAjax tries to get all the cascaded tables records based on sys_class_name.

3) There is a problem PRB1363518 in the platform that failed to populate the sys_class_name on fm_expense_line that eventually returning the null in sys_class_name.

4) Since the sys_class_name returns null the UI action script fails in split function.

5) If you open the below URL you will find few records:

https://instance_name.service-now.com/fm_expense_line_list.do?sysparm_query=sys_class_name%3DNULL&sysparm_view= 

Resolution

Please update below records with sys_class_name value to the table name i.e "fm_expense_line". You can refer below sample script for deletion. Please change this as per your testing.

Affected Records link:

https://instance_name.service-now.com/fm_expense_line_list.do?sysparm_query=sys_class_name%3DNULL&sysparm_view= 

Sample Script:

var grExpenseLine = new GlideRecord('fm_expense_line');
//Limit the number records to update.
grExpenseLine.addEncodedQuery('sys_class_name=NULL');
grExpenseLine.setLimit(5);
grExpenseLine.query();
while(grExpenseLine.next()) {
//print the sys_id for tracking
gs.info('Updating SYS_ID : ' + grExpenseLine.sys_id);
grExpenseLine.sys_class_name="fm_expense_line";
grExpenseLine.update();
}

Additional Information