Issue with "onAfter" script with in transform map.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 12:09 PM
Hi All,
We are facing an issue with the onafter script that we use in transform.
we are trying to bulk update the Records and we want the records which have been updated to update "work-notes" as well.
We have used the following code
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if(action == "update")
target.u_work_notes = "The Ordered fields of the asset have been updated as per STRY##";
gs.log('The asset with the following serial number is updated: ' + target.serial_number);
})(source, map, log, target);
How ever
it isnt updating the record worknotes
Please let us know if we have to correct something on the same.
Thank you,
Kamal
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 02:47 PM
I believe you need to remove the "u_" on u_work_notes - the out of box work notes field is just work_notes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2017 03:54 AM
Hi Kristen,
I have did the same,
Still no update has occered.
Anyother way where i can check on?
thanks,
Kamal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2017 12:39 AM
Hi Kamal,
As per your script it seems that the target table has a customized work_notes fields. Could you confirm if it is OOB or a cutomized one.
If it is OOB then try using work_notes instead of u_work_notes
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if(action == "update")
{
gs.log('In loop');
//target.u_work_notes = "The Ordered fields of the asset have been updated as per STRY##";
target.u_work_notes = "The Ordered fields of the asset have been updated as per STRY##";
gs.log('The asset with the following serial number is updated: ' + target.serial_number);
}
gs.log('Out of loop');
})(source, map, log, target);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2017 03:53 AM
Hi Jaspal,
The name of the field work notes is "u_work_notes",
I have tried your code,
But no update has been occired on the same.
Can you let me know how can we achieve this?
Thanks,
kamal