Transform script log update

rog
Giga Contributor

Hi,

I need help with the transform script logs. Currently I am updating a bulk of assets and I need to put in logs to check.

I need logs to check which assets have been updated and which assets have not been updated in the transform.

Any suggestions are welcome.

ty.

14 REPLIES 14

rog
Giga Contributor

HI,



Below is the after code I have used, it did not return me the values of the asset serial numbers.



var rc = new GlideRecord("alm_asset");


gs.log('The asset with the following serial number is updated: ' + rc.serial_number);



Thanks.


karthik73
Mega Guru

Hi Roger,



You can refer the target record as target., in this case you can just use target.serial_number.


rog
Giga Contributor

HI Karthik,


will this work?



gs.log('The asset with the following serial number is updated: ' + target.serial_number);


karthik73
Mega Guru

Yes Roger, it should. I have similar statements in my transformation scripts.


rog
Giga Contributor

HI Karthik,



But the catch is that I need only logs for the updated records.



The above script will trigger logs even if the asset is not updated(error).



Thanks.