I want to change the display name of Asset & to be same as CI

vinzz
Kilo Contributor

Hi,

 

OOB display name of asset is combination of Asset tag & model id.

But I want the display name of asset to be same as CI name.

Please suggest some solution.

 

Thanks

1 ACCEPTED SOLUTION

Hi,

Go to AssetUtils Script include and See beow function and change as i did.


Below is the OOB code which i have modified:

calculateDisplayName : function(asset) {
var display_name = "";
if (asset.asset_tag)
display_name += asset.asset_tag + " - ";
if (asset.model)
//display_name += asset.model.display_name; Instead of this we use below line

display_name += asset.ci.name;

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

asset.display_name = display_name.trim();
return true;
},

 

Thanks,
Ashutosh Munot

View solution in original post

7 REPLIES 7

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

There is a Business rule on asset table called as calculate Display name.


Please check that there you have to do some changes. Make sure you CI is mandatory in this case. Or else it will land up in empty display name.

 

Thanks,
Ashutosh Munot

HI,


This is a script include where you have to do changes.

new AssetUtils().calculateDisplayName(current);

 

Thanks,

Ashutosh Munot

Hi Ashutosh,

 

Thanks for the reply, I am not sure how to update the script include as am not so much into scripting.

Any pointer will be helpful.

Hi,

Go to AssetUtils Script include and See beow function and change as i did.


Below is the OOB code which i have modified:

calculateDisplayName : function(asset) {
var display_name = "";
if (asset.asset_tag)
display_name += asset.asset_tag + " - ";
if (asset.model)
//display_name += asset.model.display_name; Instead of this we use below line

display_name += asset.ci.name;

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

asset.display_name = display_name.trim();
return true;
},

 

Thanks,
Ashutosh Munot