- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2016 07:30 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2016 01:16 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2016 12:40 AM
How does the output of these log lines show?
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);
Regards,
Sergiu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2016 01:05 AM
When i run the script and check the logs i get the following output:
MP: before source.u_sys_id = 24043f494fa7c200a5f5b4a18110c765 target.sys_id =
MP: after source.u_sys_id = 24043f494fa7c200a5f5b4a18110c765 target.sys_id = 24043f494fa7c200a5f5b4a18110c765
However when i search the company and check its sys_ID, it shows me the following id:
feba061f4fb856000f901b818110c78e
Thanks
Menosshan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2016 01:16 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2016 01:39 AM
Hi Simon,
Thanks for your suggestions, i managed to find the issue. The problem was that the source table has two sys_id's and i just choose the wrong one. There was one "sys_id" and another called "Sys_id". I picked the wrong source but now it seems to match the id's.
Thanks a lot for your input and all the others who replied with suggestions!
Menosshan