How to change the display name of the asset to Serial number - Model?

User205031
Tera Contributor

Hi All,

 

Currently, the display name in asset_hardware table shows as 'Asset tag - Model', my requirement is to change it to 'Serial Number - Model'.

Please suggest some solution.

 

Thanks

5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

Hi

there is a Business Rule "Calculate Display Name" (https://<YOURINSTANCE>.service-now.com/nav_to.do?uri=sys_script.do?sys_id=5814a034eb3321005ecfa9bcf1... ) which does the job. Change that BR according to your needs.

Maik

Amarjeet Pal
Kilo Sage
Kilo Sage

Hello @User205031 ,

There is a business rule as mentioned by @Maik Skoddow .
But it get displayed by Standard universal name , best practices is to use in the same manner but if client wants so you can update the business rule and achieve it. Do let me know if you need help in the scripts.

Thanks

Amarjeet Pal

Hi Amarjeet,

 

Yes I need help in scripting. I found there is a script include 'AssetUtils' which has a function calculateDisplayName. I am not able to understand how to modify it so that display name shows 'Serial number - Model'

 

I also want the existing Assests display name should show as 'Serial number - Model'

 

Please help

Hello @User205031 ,

Try something like this 

calculateDisplayName: function(asset) {
var display_name = "";
if (asset.serial_number)
display_name += asset.serial_number + " - ";
if (asset.model)
display_name += asset.serial_number.display_name;

if (asset.display_name == display_name)
return false;

asset.display_name = display_name.trim();
return true;
},
Please mark helpful to all the responses and correct to close the thread.