Can we overwrite the system fields (created by, created date, updated by, etc) with the input value from transform map

udaykulal
Giga Contributor

I am bulk importing historical Incidents. As per the client requires the created date should be back dated to the original date provided in the excel. However even though I mapped the fields properly, the created by and created date is taken as the user who is doing the action. I was able to map system fields and update via tranform map in User table. Only for incident table it doesn't seems to work? Has anybody faced this issue before ?

Regards

Uday

17 REPLIES 17

peterraeves
Mega Guru

I don't have experience with this, but I can think of 2 things I would try in your situation:


- When you create a Transform Map, uncheck 'Run Business Rules'


- Click run script and try the following script:



(function transformRow(source, target, map, log, isUpdate) {


  target.autoSysFields(false);


})(source, target, map, log, action==="update");



Not sure, whether it will still run the normal mapping if you run that script, but putting autoSysFields to false, prevents the system from writing the fields created, etc


Hi Peter


I tried both option, It did not work for me.


acirovic1
Giga Expert

Yes you can. Question is whether you should do it.


In this case, he obviously should do it or his reports would all be incorrect and misleading. So could you provide with the solution, how he could do so?