Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

function onChange(control, oldValue, newValue, isLoading, isTemplate) what is isTemplate?

sonam123
Kilo Contributor

what is the use of isTemplate?

@

6 REPLIES 6

Mike Allen
Mega Sage

If the form you are using applies a template, it will ignore this client script.


Chuck Tomasi
Tera Patron

That parameter is a boolean that says "This form was loaded using a template."



Creating a Template - ServiceNow Wiki


Toggle the template bar  


Thanks ctomasi for your helpful reply . What the below function is returning with isTemplate?


function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading) {


          return;


    }


  var a=g_form.getDisplayBox('caller_id').value;


  var num=g_form.getDisplayValue('number');


  alert('hello'+a+','+num);


  alert('oldvalue'+oldValue+','+newValue)


   


}


Hi Sonam,



isTemplate - It identifies whether the change on the form occurs as part of a template load or not.


Client Scripts - ServiceNow Wiki



Please let me know if you have any questions.