Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Client side use of applyTemplate() after upgrading to Jakarta

jkc
Giga Expert

You can apply a template in a client script doing this:

applyTemplate(template_sys_id);

But after upgrading to Jakarta this does not work.

I know that it would not work on the new portals, but I did not expect it not to work in my record producers displayed in "old" portals and in "back end".

Anyone who has a solution to this??

1 ACCEPTED SOLUTION

Martin29
Kilo Expert

Hi Jan,



i can`t confirm this isn`t working.


We`re using this in an onLoad script to complete some form details when the form loads in backend and it`s working fine in Jakarta (patch 3) as it did before in Helsinki.



So maybe there`s an issue with the templates or the setup eventually?



I know - not a solution - but at least it doesn`t seem to be broken 😉



e.g. usage in our case:


var de = sys_id_for_germany;


applyTemplate(de);



This fills all the form fields as defined in the template   on load - just as it should.



Regards!



Martin


View solution in original post

3 REPLIES 3

Martin29
Kilo Expert

Hi Jan,



i can`t confirm this isn`t working.


We`re using this in an onLoad script to complete some form details when the form loads in backend and it`s working fine in Jakarta (patch 3) as it did before in Helsinki.



So maybe there`s an issue with the templates or the setup eventually?



I know - not a solution - but at least it doesn`t seem to be broken 😉



e.g. usage in our case:


var de = sys_id_for_germany;


applyTemplate(de);



This fills all the form fields as defined in the template   on load - just as it should.



Regards!



Martin


I had another client script, with same order, that made the form read-only. Hence it did not fill out the fields.


Once i disabled the read-only functionality, it worked.



Thanks for the answer..


Thanks & Welcome 😉