Standard change Template variable update change request value

Nolan3
Kilo Guru

Hello All,

Does anyone know how I can populate service on a change request values section of a proposed new standard change with the same value that is entered in the service variable on the record producer?

So when a service is selected in the first area it will auto populate the service in the change request values area to match.   My goal is just to save the person who is filling out the new standard change template from having to enter the save value twice.

Thank you for your help!

Service.JPG

4 REPLIES 4

Jon Barnes
Kilo Sage

You want to do this client side? I have interacted with template fields like this before, but I did it on the server side, I haven't done it on the client before, so not sure there is an API for it.



I did just try a basic g_form.setValue('template', '[template value]') and it seemed to work. The template values are encoded like this:



field1=value1^field2=value2^EQ



So, you can put an onchange client script on that service field and set your template field accordingly. Keep in mind if there is a chance your template field already has something in it, you may have to parse it out save the new value and string it back together.



make sense?


Thanks for the help Jonathan.



I am new to scripting so here is what I did but still not working so must have misunderstood some of the details you provided.



On the Propose a new Standard Change Template I created a Catalog Client Script with all these settings.



Service.JPG


Your setvalue function isn't quite right. It would need to be more like this. But keep in mind you need to use the correct variable name of the template variable:



g_form.setValue('template', 'business_service='+newValue+'^EQ');


Jonathan,



Sorry still not having any luck as not exactly sure how to figure out what the variable name of the template variable is.   I tried to show xml of an open proposal (see screenshot below) but it just shows the sysid of the business service that was selected when manually filling out the business service under the change request value.



I tried this code but at this point just guessing since not sure how to find the variable name for the template variables.   I figured it would be field 1 since it is the first field of my change request values.



g_form.setValue('template', 'business_service=field1^EQ');



g_form.setValue('template', 'business_service=value1^EQ');



templatevalue.JPG



Thank you!