how to trigger change template (standard change) in On-before transform script

amar7
Kilo Guru

Hi community ,

 

we are creating a change request (standard change) via transform map, we have created a standard template also ,

we have to trigger the template in the transform map when ever the (action == "insert" ).

 

Template :

amar7_0-1694416460517.png

 

can some one help us with the script how we can trigger the template .

 

Thanks in Advance !!!

 

 

 

 

2 REPLIES 2

OlaN
Giga Sage
Giga Sage

Hi,

You can also set up a Flow that creates the change record whenever an insert happens on this table.

Venkata Chaita1
Tera Contributor

Hello Amar, 

 

Try using the below script in OnBefore script

 

if (action == "insert" ){

target.std_change_producer_version = "sys_id"; // sys_id of the current version of the template. 
target.applyTemplate("name"); // template name 

}