The CreatorCon Call for Content is officially open! Get started here.

onForeignInsert() script in the Transform Map

anubhavkapoor76
ServiceNow Employee
ServiceNow Employee

Hey All,

Does any one has an idea of how to use onForeignInsert() Event in Transform Map?

Scenario: I am trying to run a transform map on table which has a a user field in it. Now if the user is not in the sys_user table then it has to be created during load. 

I have created a Field Map against the Ref field ( with Reference value name as "name") however using ForeignInsert Script to update email id

1 ACCEPTED SOLUTION

Thanks Himanshu. Yes i sorted this out and used onAfter() function.

View solution in original post

8 REPLIES 8

Thanks Himanshu. Yes i sorted this out and used onAfter() function.

Is the onForeignInsert transform script mostly for inserting events?

Yes for reference type

Hi Himansh,

 

Can you please give a sample code on this syntax,

var e = new GlideEvent("myimport_ChoiceCreate", action, value, "");
e.insert();

 

Need some help on what should be passed to the parameters. I am trying to onChoiceCreate transform script and if I could get some sample code that creates a choice it would be more helpful.

 

Thanks, 

Ashwini Y