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

Issue with "onAfter" script with in transform map.

kamal11
Giga Expert

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

22 REPLIES 22

kristenankeny
Tera Guru

I believe you need to remove the "u_" on u_work_notes - the out of box work notes field is just work_notes.


Hi Kristen,



I have did the same,



Still no update has occered.



Anyother way where i can check on?



thanks,


Kamal


Jaspal Singh
Mega Patron
Mega Patron

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);


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