client Script is not working

pavana3
Tera Expert

example i have 2 fields one is reference field if i will select category name based on that category group should display .. I used Onchange client script .. like below

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
var appliref= g_form.getReference('application_category', userlookup);

    function userlookup(appliref) {
       
        g_form.setValue('u_application_category_group', appliref.apm_application_category_group);

    }

    //Type appropriate comment here, and begin script below

}
1. application_category  is the reference field 
2.u_application_category_group  is the text field   -- in this field its displaying sys_id instead of value // this category group also as a reference field how to get value instead og sys_id i tryied getvalue but not available getDisplayValue()
 
If anyone know please help me .
 
1 ACCEPTED SOLUTION

@pavana3 

Hope you are doing good.

Did my reply answer your question?

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

5 REPLIES 5

@pavana3 

Hope you are doing good.

Did my reply answer your question?

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