- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 04-30-2023 03:05 AM
Recently, I came across a question where the questioner wanted to remove the asset tag from the Display name field whenever the table was referenced as a reference field in some other table or catalog item/record producer variable.
Questioner was not open for any scripting hence this is the alternative solution I suggested using a function field which was going to use nested GlideFunction calls.
1. As a part of the solution one need to define a custom field Asset Name(u_asset_name) on the alm_hardware field. The type of field should be a Function field
Here is the Function definition
glidefunction:substring(display_name, add(length(asset_tag),4), subtract(length(display_name),add(length(asset_tag),4)))
In this function field, we have used nested GlideFunctions like add, subtract and length inside the substring GlideFunction
Change the display field as follows. Display Name field should be set to false and Asset name custom field's display field should be set to 'true'.
Once done, this is how your new field Asset name should look
Tested the display field by adding a reference field (alm_hardware) on a record producer and it displays the Asset Name field as display field.
Note: Function fields are not stored within database and their value is always calculated whenever the rows from the table are read.
Hope this helps.
- 2,220 Views