Displaying a Non-Display Field in Reference Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 05:09 AM
I am wondering if it is possible to do the following:
A,B, and C represent columns in table 1 where A is the Display field.
A | B | C |
X,Y, and Z represent columns in table 2 where X is the Display field.
X | Y | Z |
In a form view for table 2, is it possible to have a reference field which references a column other than the Display field, say C, from table 1. So a user can type the data related to table 1, column C and store that in the reference field on the form for table 2?
Changing the Display field for table 1 would effect other forms, therefore, I cannot take that approach.
Any ideas?
- 6,907 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 12:05 PM
I revised my opinion. I think this could be done with an onload client script that simply replaces the text contents of the choice list with your desired field values.
The following line would change one option:
jQuery('#field option:contains("oldValue")').text('newValue');
You could put this into a loop for your table:
var gr = new GlideRecord('yourTable');
while (gr.next()) {
jQuery('#field option:contains("' + gr.getDisplayValue() + '")').text("'gr.column_c'");
}
Obviously you would need to customize this for your table and field names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2019 03:33 AM
This will provide both the display value and the field selected by ref_ac_columns.
Do you have any other method to display only non display field??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 02:22 PM
You may be able to accomplish this with a dictionary override:
http://wiki.servicenow.com/index.php?title=Dictionary_Overrides
This works for tables that are extended though. Example from the Wiki: the Story [rm_story] table uses the short description as the display value in reference fields instead of the number, as defined in the Task [task] table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2014 07:20 AM
Unfortunately, it isn't an extended table.