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

var request = current.request.getRefRecord();


request.short_description = current.variables.Request_title;


request.update();



This is the script I am using to try and copy the Request title into the Request Short Description field.   I get the following error:


"Error running business rule, exception: The undefined value has no properties."



What am I missing?


Looks okay, assuming the variable name is correct, what table are you running the business rule on? Is it set to run after and on update as well?


it's works in 2019 \0/