- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 11:31 PM
Hi,
We have this company variable on one of our record producers, the company variable is a reference to the core_company table.
We have added another variable called 'Company ID'. Based on the company that is selected in the company variable, the Company ID variable should auto complete. The company ID is a custom field on the core_company table.
How do we autocomplete this field?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 11:38 PM
no scripting required. you can use Catalog lookup definition
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 11:38 PM
no scripting required. you can use Catalog lookup definition
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 01:05 AM
@Ankur Bawiskar - Hi Ankara, thank you for your response we ended up actually going with an onchange catalog client script and an unload catalog client script.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var comp = g_form.getReference('company', callback);
function callback(company){
var sa = company.getValue('backend_name_of_field_from_reference_table');
g_form.setValue('backend_name_of_new_variable_in_record_producer', sa);
}
//Type appropriate comment here, and begin script below
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 01:43 AM
there is no script required as per my earlier comment.
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader