Copy variables from Catalog Item into Request form fields?

mitzaka
Mega Guru

Hi SNC,

 

I use a catalog item which has a couple of variables for Short Description/Description. I managed to get them copied into the RITM, but I need a way to copy them into the Request (REQ) which is initially created after submission, because the first notification is actually based off the sc_request table and I need to provide users with the variable content in this first notification.

 

What's the easiest way to do this?

Thanks!

1 ACCEPTED SOLUTION

In my case where I wanted the Short Description field copied from variable into form, the final solution was an AFTER business rule on Requested Item table with the following script:



var request =current.request.getRefRecord();


request.short_description = current.variables.short_description;



Note: the name of my variable is short_description as well.


So that worked perfectly.


View solution in original post

22 REPLIES 22

Yes. that correct ... Is the requirement like whenever a particular request field is updated, the corresponding info should get copied to RITM's?



If thats the case, you would need to write a business rule on request table, do a gliderecord to get the child RITM's and update the corresponding field.


Hi Kalaiarasan,

I have same requirement where I need to copy variables from one existing RITM to another new RITM which approve will be raising from approval notification.

Any solution you can suggest will be helpful

Lucien1
Giga Expert

Hi all,



I am trying to create a business rule that will look at the catalog Item that has been chosen and copy info from a variable. We have 7 catalog items and with each item, there is a different variable to copy from. Is there anyone that has done this under 1 business rule as I don't want to create multiple rules.



Thanks all,



Lucien


Hi,

Did you find a solution for this multiple catalog approach?

jonathandix
Tera Contributor

This answer is correct, however will not work without:



request.update();



Full required code will be:



var request =current.request.getRefRecord();


request.short_description = current.variables.short_description;


request.update();