
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 01:14 PM
What are the different sequence of transform scripts?
I am interested in
- Big transform map script
- Source script in Field map
- Other transform scripts like on before, on after, etc
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 01:24 PM
Hi Ravio,
Here goes the order on which I believe it executes:
a) onStart
b) onBefore
c) Transform Map Script (right before the update takes place)
d) Fields Mapped Transforms
e) onAfter
f) onComplete
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2020 04:27 AM
I think I've searched for this image at least 5 times in the past few years, finally saved it 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 10:02 AM
A while back I checked this out by adding some logging into all the different transform scripts scripts, to see the order they came out. Results as follows:
1) onStart script
2) For each record in the import set:
a) Field maps for coalesce fields
b) onBefore script
c) Field maps for non-coalesce fields
d) Main transform map script (the one you see if you tick the "Run script" checkbox)
e) The insert/update on the database
f) onAfter script
3) onComplete script
Which means the onBefore script will know which record is being created or updated, but won't know the final values of the fields in the target record.
I didn't check the onForeignInsert or onChoiceCreate scripts.
Hope this helps!
Regards
Michael

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 04:45 AM
Hi All,
Am having a doubt, whether can we refer source in the OnAfter transform map script, because it will work only after the source record was inserted in the database, so thought to check with you all.
I am trying to do something similar as below in the example, however source field is not copied in OnAfter transform script, Can anyone guide me what is the best approach to do that.
if(!source.u_business_analyst.nil())
{
var timecard1 = new GlideRecord('time_card');
timecard1.initialize();
timecard1.task = target.sys_id;
timecard1.category = 'Business Analyst';
timecard1.user = source.u_business_analyst; // This field alone not updating for me while inserting a new record and am using this in onAfter transform script.
timecard1.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 05:21 AM
I use source on an onAfter:
if(source.u_reference_sysid && ((target.priority < 3) || (target.urgency == 0))){
status_message = 'Only comments are allowed on major incidents. Any comments or activity log entries have been recorded to the incident. All other fields have been ignored.';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2018 02:31 AM
This is very accurate and helpful information. Thank you!
The detail on coalesce fields being run before the "onBefore" scripts is very important. I ended up in this thread because of that 😉