XML Import

Sankaran_Balasubramonian
Member Posts: 20
Hi All,
Scenario:
I am trying to do a purchase order import using the XMLPort functionality of NAV. Everything works fine, until a point where the data, that comes in through XMLPort does not match with what exists in NAV.
For Ex : Lets say, my PO has dimension for each line item in the PO. One of the dimension or over the dimension value does not exist in NAV. In this scenario, the XMLPort fails. Pretty obvious, that is fails.
In order to overcome this situation, I have written a piece of code that would automatically insert the dimension data, if it is missing. I am still having issues with the PO getting imported.
Problem:
Is there a way we can get the error of the place where which NAV fails to import. i.e. is there a way to get to the statement / function which resulted in this error. I did search in the group and found something called GETLASTERRORTEXT. I am not sure which post it is. But when I try to use that keyword, I am getting a message saying that no such keyword exists (The message I get is "You have specified an unknown variable, which is NAV default behaviour.
Experiments:
I tried using the Debugger / Code Coverage, but I am not able to reach the place where it breaks.
Thanks in advance for all your help.
Update :
It works well. All I had to do was ignore the boolean return value when I Import. Take a look at the code, that would tell more info.
Original Code (Which was giving issue)
Modified Code (Which fixed the issue)
Solution:
The modified code threw a message saying that the Dimension Code does not exists. This give more insight into the problem, where I can focus on getting the dimension inserted before it processes.
Thanks & Best Regards
Balaji
Scenario:
I am trying to do a purchase order import using the XMLPort functionality of NAV. Everything works fine, until a point where the data, that comes in through XMLPort does not match with what exists in NAV.
For Ex : Lets say, my PO has dimension for each line item in the PO. One of the dimension or over the dimension value does not exist in NAV. In this scenario, the XMLPort fails. Pretty obvious, that is fails.
In order to overcome this situation, I have written a piece of code that would automatically insert the dimension data, if it is missing. I am still having issues with the PO getting imported.
Problem:
Is there a way we can get the error of the place where which NAV fails to import. i.e. is there a way to get to the statement / function which resulted in this error. I did search in the group and found something called GETLASTERRORTEXT. I am not sure which post it is. But when I try to use that keyword, I am getting a message saying that no such keyword exists (The message I get is "You have specified an unknown variable, which is NAV default behaviour.
Experiments:
I tried using the Debugger / Code Coverage, but I am not able to reach the place where it breaks.
Thanks in advance for all your help.
Update :
It works well. All I had to do was ignore the boolean return value when I Import. Take a look at the code, that would tell more info.
Original Code (Which was giving issue)
IF XMLPORT.IMPORT(50005,POInStrm) = TRUE THEN BEGIN FlPrvdr.CLOSE; // Archive The Original Document NVNAVConn.ArchiveFile(sOrgFlNm,sArchPth,TRUE,'PurchaseOrderXMLImport'); END ELSE BEGIN NVLogPrvdr.TraceError(STRSUBSTNO(Err0005,sFileName),TRUE,2,3); END;
Modified Code (Which fixed the issue)
XMLPORT.IMPORT(50005,POInStrm);
Solution:
The modified code threw a message saying that the Dimension Code does not exists. This give more insight into the problem, where I can focus on getting the dimension inserted before it processes.
Thanks & Best Regards
Balaji
--
Thanks & Best Regards
Sankaran Balasubramonian
Thanks & Best Regards
Sankaran Balasubramonian
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions