Codeunit with three XMLports - Rollback?
pn7
Member Posts: 17
Hello
This is my first post to mibuso so bear with me.
So I have a Codeunit which launches three XMLports. The problem shows up when the codeunit reaches the last XMLport and if the run time error occurs with some validation -> There are no Rollbacks. How one must build this that it rolls back each used XMLport?
To give you context: I'm importing sales headers and sales lines from different files.
Navision version: 2015
Has any one have solution for that kind of problem?
Yours truly,
pn7
This is my first post to mibuso so bear with me.
So I have a Codeunit which launches three XMLports. The problem shows up when the codeunit reaches the last XMLport and if the run time error occurs with some validation -> There are no Rollbacks. How one must build this that it rolls back each used XMLport?
To give you context: I'm importing sales headers and sales lines from different files.
Navision version: 2015
Has any one have solution for that kind of problem?
Yours truly,
pn7
0
Comments
-
I am not sure but this seems to be the appropriate solution as per my understanding -
Assuming you xmlport are XMLA, XMLB and XMLC
1. Create Temp (staging Table) for all these three tables where actually want to import record.
2. insted of XMLA.Import(parameters) UseTransferRecord := FALSE; IF(XMLA.Import(parameters)) THEN XMLA.Close; ELSE TransferRecord := FALSE; IF XMLB.Import(parameters)) THEN XMLB.Close; ELSE TransferRecord := FALSE; IF XMLC.Import(parameters)) THEN BEGIN XMLC.Close; TransferRecord := TRUE; END; IF TransferRecord THEN // Code to Transfer Record to Actual Tables and Delete Record from Staging Tables. ELSE // Code to Delete records from Staging tables.Where TransferRecord Is a Boolean.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page1 -
[Topic moved from 'NAV Tips & Tricks' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
