OnComplete Script, why it is giving undefined
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
(function runTransformScript(source, map, log, target ) {
var runGR = map.sys_id;
if(runGR){
var inserted = runGR.inserts;
var updated = runGR.updates;
var rejected = runGR.ignored;
var total = runGR.total;
var summary = "Inserted: " + inserted +
", Updated: " + updated +
", Rejected: " + rejected +
", Total: " + total;
gs.eventQueue("Incident.import.complete", null, summary, "");
}
})(source, map, log, target);
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
You're trying use a string as a GlideRecord. In your script runGR is a string, not a GlideRecord, so anywhere you use runGR and try to access the attribute, you get undefined because it doesn't exist. If you're trying to use map as a GlideRecord, then use map.<yourAttribute> instead of runGR. <yourAttribute>
If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!
