The Zurich release has arrived! Interested in new features and functionalities? Click here for more

sys id not matching

menoss
Kilo Contributor

Hi all,

Im in the process of trying to import company details. However the source sys_id seems to match the target sys_id but when i check in the "companies" section, it seems to make up another sys_id.

I have the following script:

var name = source.u_name.toString();

log.info("MP: name = " + name.toLowerCase());

if(name.toLowerCase() == "evides"){

  ignore = false;

  log.info("MP: Imported " + name);

  log.info("MP: before source.u_sys_id = " + source.u_sys_id + " target.sys_id = " + target.sys_id);

  if (action == "insert"){target.setNewGuidValue(source.u_sys_id);}

  log.info("MP: after source.u_sys_id = " + source.u_sys_id + " target.sys_id = " + target.sys_id);

}

else{

  ignore = true;

  log.info("MP: Ignored " + name);

}

Where am i going wrong?

Thanks in advance for your help!

Menosshan

1 ACCEPTED SOLUTION

Hi Menosshan,



Is it possible the sys_id's exist elsewhere on the system?   I'd have thought it best not to set a sys_id of a record unless you're importing XML records between instances



Simon


View solution in original post

6 REPLIES 6

As @simon westwoord mentioned above. It is recommended to use XML in case you want to retain the sys ids (generally in case of sub production to production).


Mujtaba Amin Bh
Mega Guru

Hello,



I guess target.sys_id will give you the sys id of target table and not record.