Dataport + CodeUnit to log
ben5000
Member Posts: 110
Hi,
I've created an dataport(export) and a codeunit.
The idea is to do an export and keep track of what was exported.
Here is what I'd like to do:
1) Dataport is used to set filters on a record (via requestform)
2) The record is passed to the codeunit which writes the data in a table (log)
3) The export to text file occurs
4) If export succeded then commit the transaction (insert)
5) If export failed then the transaction is not commited
Is it possible to implement?
Thanks
I've created an dataport(export) and a codeunit.
The idea is to do an export and keep track of what was exported.
Here is what I'd like to do:
1) Dataport is used to set filters on a record (via requestform)
2) The record is passed to the codeunit which writes the data in a table (log)
3) The export to text file occurs
4) If export succeded then commit the transaction (insert)
5) If export failed then the transaction is not commited
Is it possible to implement?
Thanks
0
Comments
-
And what is the problem? If there is error (export failed), the transaction is rolled back automatically. If all is ok, transaction is commited thus log is commited too... Or you need something different?0
-
The problem is that the export failed but not the import in the log table.0
-
Than you need to run the dataport from codeunit which you run through "if CODEUNIT.RUN then" or you need to use singleinstance codeunit with temporary table for the log which will be flushed somehow after the error (thus again, you need to be able to run code after the report, e.g. by running the code from the codeunit in IF-THEN statement).0
-
Thanks for your quick reply,
I passed a wrong parameter from the dataport to the codeunit so the filter was empty for the dataport but it made sense in the codeunit. That's why the codeunit worked and the dataport did not.
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
