In a Transform, does the onAfter script execute if 'ignore' is set to true in the transform script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2011 12:52 PM
In a transform script, the 'ignore' variable is being set to true.
However, the 'onAfter' script (or event handler) is still executing.
This is unexpected according to the documentation where it says about 'ignore':
where if true causes the current import row to stop processing.
link to documentation
Is it expected that the 'onAfter' script get called if the transform script sets 'ignore' to true?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2014 04:17 PM
Having the same behavior in our test. Would like to know this as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2015 01:23 AM
I had the same issue and I resolved it by creating custom variable in onBefore transform script (or in Script of Transform Map record) and I set it to true if onAfter script should be ignored, otherwise to false. Then in onAfter script I checked this variable and it was available there. This was tested on Fuji release.
On Before transform script:
if (/* validation code indicates invalid values */) {
ignore = true;
var wasIgnored = true;
} else {
var wasIgnored = false;
}
On After transform script:
if (wasIgnored == false) {
// run my on after code
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2017 07:21 AM
> Is it expected that the 'onAfter' script get called if the transform script sets 'ignore' to true?
Looks like: Transform Map Scripts - ServiceNow Wiki
"If you have defined an onAfter script, the onAfter script runs for the current row even if the ignore flag is set to true."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 11:55 AM
Can ignore be set to true in an onAfter script or is the target record already saved?