Hello.
I use XMLport-s to import data from XML files into Navision. Sometimes the data in the xml files already exists in Navision datrabase. How can I tell the XMLport to insert only the non-existing records in the database.
Thank you in advance.
XMLPorts only know how to create records, at least I have not been able to get one to update existing ones. The standard behavior seems to be that it leaves existing records alone, so you would have to program it to update them. New records should just go right in.
I don't want to update the records, like the behavior of the Dataports. I just want not to import the records which are already in the database, because I get "Record already exists" error.
Then you use a record variable of the same type as the one you are importing, and you put something in the Import::OnBeforeInsertRecord trigger. Similar to Rik's example, but more like this:
IF TempCustomer.GET(<ID value from the Dataitem>) THEN
currXMLport.SKIP;
Then you use a record variable of the same type as the one you are importing, and you put something in the Import::OnBeforeInsertRecord trigger. Similar to Rik's example, but more like this:
IF TempCustomer.GET(<ID value from the Dataitem>) THEN
currXMLport.SKIP;
Why the Command 'currXMLport.SKIP' does't work in the OnBeforeInsertRecord trigger?
The XmlPorts inserts the dataitem, cause the Onafterinsert-Trigger runs.
How can I solve the Problem without deleting before?
Hello. I'm having the same problem. The CurrXMLport.SKIP seems to be ignored in any trigger I try. The table is set to a temporary table but it's trying to insert the records anyway. Any ideas?
Comments
Try: Make the SourceType Table Temporary, and then insert the records manually by code..
Rvduuren
RIS Plus, LLC
RIS Plus, LLC
RIS Plus, LLC
Here is what I did for one ot the XMLports and it still gives me "Record already exists" error
If I make the SourceType Table Temporary, I can't export enything, because the Temporary Source Table will be empty when exporting.
I have the same problem. The workaround I did was to delete the existing record on the Import::OnBeforeInsertRecord() trigger.
Did you find a better work-around?
thanks
Why the Command 'currXMLport.SKIP' does't work in the OnBeforeInsertRecord trigger?
The XmlPorts inserts the dataitem, cause the Onafterinsert-Trigger runs.
How can I solve the Problem without deleting before?