Notifications

30 views

Symptoms

The creation of a new table is forcing "undefined" into the name

Release

All versions

Cause

1. When creating a new table, the OOB client script "Table Label Change" on sys_db_object is used to auto-populate the "name" when the label is edited.

https://<instance-name>.service-now.com/sys_script_client.do?sys_id=b4e95dd2c3203000bac1addbdfba8f5d 

2. The script passes a parameter "g.scratchpad.scope" (scope of the record) to a js function "setTableNameFromLabel" (on generate_table_name_with_scope.js) which returns the name.

3. The OOB on-display business rule "Set Current Record Scope in scratchpad" on sys_metadata is used to set the "g_scratchpad.scope" parameter value for the record.

https://<instance-name>.service-now.com/sys_script.do?sys_id=4659d132d7232100b6bddb0c8252039e

4. If the above business rule is deactivated or deleted, then the value of "g_scratchpad.scope" is undefined which causes the js function to return the name with "undefined" in it.

Resolution

Reverting the business rule back to OOB version should fix the issue. Tables already created with "undefined" in the name can be deleted using TableUtils API.

Additional Information

This can also happen if any other custom script on sys_metadata or sys_db_object is updating the value of "g_scratchpad.scope" parameter to undefined. If so, the custom script can be modified so that the parameter is not set to undefined.

Article Information

Last Updated:2019-06-17 05:07:40
Published:2019-06-17