Calculate the Display Name value on an asset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2016 07:18 AM
I'm trying to calculate the Display Name value on an asset, but I need it to be different based on model category. For example: I need the Display name to be different for the model category "vehicle", all the others can stay the same. Right now, Display Name is a calculated field with :
current.display_name= current.ci.manufacturer.getDisplayValue() + ' ' + current.model.getDisplayValue() .
This works to pull the Manufacturer and the Model into the Display Name, but I tried adding in a business rule to change this if the model category is "vehicle" change field value "Display Name" to:
current.display_name= current.u_number.getDisplayValue() + ' ' + current.u_vehicle_year.getDisplayValue() + ' ' +current.ci.manufacturer.getDisplayValue() + ' ' + current.model.getDisplayValue()
It basically blanks out the Display Name if the model category is vehicle, but if it's not vehicle the Display Name value displays as it should. Is it possible to do this? Does this need to go into the script section under the Advanced tab instead?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2016 08:53 AM
my apologies for all of the questions. I'm still learning the scripting side of things.
current.model_category == 'Vehicle' is what I have in the condition and it doesn't seem to be working. I've tried current.getValue(model_category) == 'Vehicle' as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2016 09:37 AM
model_category is a reference field I believe. Put current.model_category == '<sys_id of the Vehical>'.
It should work.