Concatenate two fields value and display in one field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 07:01 AM
Hi,
I have a table location there I am creating a new field that is of reference type and the reference table is knowledge,but I want to display the two fields data from knowledge table in single reference field on location table.
Both the fields on knowledge are of string type.i.e Number and Short Description
Can someone guide how we can perform this.
Thanks
Vibhor
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 08:17 AM
I don't know of a way to change the way a reference field looks on one table, if you want to change the way a reference field displays on all tables you will need to change the display value on the referenced table. So for your example you will need to create a new field on the knowledge table and set that to be a calculated field. The calculation script should be:
current.number + ' ' + current.short_description;
Then you will need to check the Display box on your new field. This will change how ALL references to the knowledge table look. So this won't help if you only want to change this one reference on the one table you have.
-Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2016 01:21 PM
Hi Stephen,
Thanks for your update.
It was helpful but I need that for single table.
If someone else can suggest more on this then please be advisable.
Thanks
Vibhor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2016 01:57 PM
Vibhor,
Do they have to be in the same field? You can leave the reference field as it is and then add another field to your form that will display the short description from the knowledge article. I use this on some fields that have references to the hardware asset tables so that I can display the serial number of the asset instead of just the asset tag number.
You just use the Configure -> Form Layout option from your form. Select the reference field, click the button in the middle over the arrows to expand out the referenced table, then select the field on the other table you want to display. I usually add a UI Policy to make that field from the other form read only so that people don't try to select the reference from that field. As soon as you fill in the value for the reference field it automatically populates the other read only boxes.
I know that isn't exactly what you are looking for, but it might be a workaround if no one else has a better solution for you.
-Steve