Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

OnChange client script for reference qualifier

Abhishek8
Tera Contributor

We have 3 variables in a Catalog Item

 

country -  Select box

business_application - Reference - cmdb_ci_business_app

service_offering - Reference - service_offering

 

Requirement is If we Select "India" in country variable 

then  business_application should list only below 2 option from table

LES/MES India
LES/MES India

 

and for service_offering ,it should list the below 2 options:

LES/MES Application for India
LES/MES Application for India

 

Similary if we Select country as Pakistan

Requirement is If we Select "India" in country variable 

then  business_application should list only below 2 option from table

LES/MES Pak
LES/MES Pak

 

and for service_offering ,it should list the below 2 options:

LES/MES Application for Pak
LES/MES Application for Pak

 

 

How to complete this requirement using Onlaod Client script

1 REPLY 1

Ankur Bawiskar
Tera Patron

@Abhishek8 

it's an easy requirement with reference qualifier

something like this, please enhance with correct choice value etc

variable -> business_application 

javascript: var query; var val = current.variables.country ;
if(val == 'India')
query = 'nameINLES/MES India';
else if(val == 'Pakistan')
query = 'nameINLES/MES Pak';
query;

add something similar for the other variable

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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