The CreatorCon Call for Content is officially open! Get started here.

autocomplete variable on record producer based on another reference field

JHughes62
Tera Expert

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?

 

 

 

JHughes62_0-1681712944961.png

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@JHughes62 

no scripting required. you can use Catalog lookup definition

Catalog Data Lookup Definition - A zero code way to fetch data like requester Details in a catalog i... 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@JHughes62 

no scripting required. you can use Catalog lookup definition

Catalog Data Lookup Definition - A zero code way to fetch data like requester Details in a catalog i... 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@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
   
}

@JHughes62 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader