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

sonam123
Kilo Contributor

what is the use of isTemplate?

@

6 REPLIES 6

Generally, the way you use it is in your return statement, like



if(isLoading || isTemplate)


        return;



That way you can stop the system from doing things to your templated record.


Hi Sonam,



If you created the form by clicking "New" and you were presented with all default values in the form, then isTemplate will be false - indicating that no template was used to populate any of the fields.



Templates can be used in a variety of ways, via record producers, applied manually with the template bar, or directly from the URL, then isTemplate will be true. Your client script can be smart enough to use that information if you choose. In most cases, people don't use isTemplate for anything. It is generally ignored. This appears to be the case with your script.