Record Producer to create new change and apply template to the change

bwilson2
Tera Contributor

I have created a Record Producer in the service catalog that contains a Lookup Select Box that shows a list of templates by their short description. What I would like to happen is when the user selects a template from the Lookup Select Box a new change is created and the specific template they selected is applied to the newly created change. Right now I have a template statically assigned in the tab labeled "Generated Record Data" in the record producer screen. So no matter what template they select from the Lookup Select Box, the template that I have statically assigned is applied to the change that is created.

Is there a way to apply the template that the user selects from the Lookup Select Box to apply to the new change, using a record producer?

Ex: Lookup Select Box options:

        Template A

        Template B

        Template C

If the user selects Template C, then Template C would be applied to the new change created by the Record Producer. I know this could be accomplished using multiple Record Producer's, one for each template. However, I am wondering if I could accomplish this using a single Record Producer.

Any suggestions?

1 ACCEPTED SOLUTION

In your lookup select box, make sure the Lookup value field in the Type Specifications section is the set to the name of the template as that is what the applyTemplate function is expecting.   then in your script you would have:


current.applyTemplate(producer.LookupSelectBoxVariableName);



The producer.LookupSelectBoxVariableName value would be set to the Template name chosen.


View solution in original post

15 REPLIES 15

jxsaxton421
Tera Guru

Is there a way to fix it on the client side? I can pick a template, but the fields don't populate from the template in the record producer and I have been searching for a a method to do this.