How to change the display name of the asset to Serial number - Model?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 06:46 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 07:51 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 10:29 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 08:43 PM - edited 08-09-2023 09:05 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 08:09 AM
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.