- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 06:24 AM
Hello,
I currently have 3 fields on an item:
1. Code search
2. Tray ID
3. Tray Name
I also have a custom table with 3 columns (u_nhsl_tray_codes_choices).
The user will select a code from 'code search', this code will have a tray id and tray name associated with it - I want to populated field 2 and field 3 with the corresponding column values, this way the user will see their selected code, ID and name across the 3 variables.
How can I achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 09:59 AM
I've managed to fix this using the following 'onChange' script, and turning the 2 and 3 variables into single line texts.
function onChange(control, oldValue, newValue, isLoading) {}
var trayTable = g_form.getReference('u_rmd_and_tray_search', populateTrayID);
function populateTrayID(trayTable) {
g_form.setValue('u_tray_id_readonly', trayTable.u_tray_id);
g_form.setValue('u_tray_name_readonly', trayTable.u_tray_name);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 07:43 AM
Hi,
Yeah it's a reference, I've also set Tray ID and Tray name to reference fields also, although I've realised that the display value for the table is the same as whatever is in u_rmd_and_tray_search so maybe that is why it won't display the other fields?
Edit: I've changed to SYS_ID but nothing is populating
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 08:02 AM
Hi,
u_rmd_and_tray_search refers to which table?
It should be u_nhsl_tray_codes_choices.
Can you share any one of record screenshot?
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 08:27 AM
So:
u_rmd_and_tray_search references the table u_nhsl_tray_codes_choices which has the 3 columns I want the values from (TRAY ID, TRAY Name, TRAY TYPE ID).
- RMD and tray search (References above table) displays TRAY Type ID.
- Tray ID (References above table) should display associated TRAY ID with the selected TRAY ID.
- Tray name (References above table) should display associated TRAY NAME with the selected TRAY ID.
I hope that makes more sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 07:28 AM
Is column 1 reference field?
If i understand correctly, all you need is to fetch couple fie fields from column 1 record and populate it on the firm. Is that right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 07:41 AM
Yeah it's a reference field.
I was originally trying to populate the ID and Name field based on the two remaining column values.
So RMD is column 1, Tray ID is column 2 and Tray name is column 3.