On Foreign Insert Script in Transform Map

pdom
Mega Expert

I have a transform Map to Insert CI's to the target CMDB table. In which I have two field maps one is "Manufacturer" and ther other one is "Vendor". Both of these fields are reference fields to Core Company table.

I have allowed the Choice create option to "create" as I want the Manufacturer and Vendor companies to be created through transform map when it does not match. It is inserting the Comapny records however it is not marking the flag "Manufacturer" on   company table to true.

I thought I would do it by creating an On Foreign Insert transform script but do not know how to access the reference record that is being inserted and mark the Manufacturer flag to true before the reference record insert.

Any Help With this would be great

Thanks

3 REPLIES 3

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Padmini,



Do you want the value for Manufacturer to be true for all the records created? If yes, you can set the default value at the dictionary to   Manufacturer?



Or you want it to be Manufacturer or Vendor based on the field? You may use Field Mapping Script to create a record using GlideRecord and set whatever values you want.



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


antin_s
ServiceNow Employee
ServiceNow Employee

Hi Padmini,



Did you get a chance to try the above?



Thanks


Antin


ffr
Mega Contributor

Hello,



I am also interested to get more information about the "onForeignInser", how do we adress the record just created by the "Create" action ? with "target" ?



Thanks