Newbie here...storing and passing a value from/to dataports

lpolliard
Member Posts: 6
After exporting information to an external file via a dataport I want to store the last entry id number. This stored value will be recalled when the same dataport is executed a second time to filter out records already exported. A detail explanation of how to accomplish this will be much appreciated.
Thanks :P
Thanks :P
0
Comments
-
I dont think there is a easy solution here, you can do it by putting the id into a database, and the restore the value when you run the report.
I can give you code for it, if you have developer access to C/AL.0 -
how about an alternative ???
Create a new boolean field on the table that you are exporting and then after each record that has been exported, update this field.
This means that next time you run the dataport you can pre-filter on the updated field being set to false.
i.e.
in the C/al of the dataport, look for the following trigger:
OnAfterExportRecord()
Once you have this then use code similar to this:myfield:=true modify;
should be as easy as thatRemember: Keep it simple0 -
I started out with this solution but learned that I could not modify a table (Check Ledger Entry) containing posted items without a special developers license. My solution was to store the Entry Id as part of the Company Information table in a newly created field and modify it after each pass of the dataport. I was having a problem with modifying this field. Thanks to your reponse it may have been because I left out the command line "modify;". I will research the use of this command in the help files and give it a try.
Thanks.0 -
I started out with this solution but learned that I could not modify a table (Check Ledger Entry) containing posted items without a special developers license
Not strictly true. Give the dataport permission to modify the "Check Legder Entry" table. Only problem is that you need a developer licence to actually add permission to the dataport for the table you mentioned.
However, this is only a 30 second modification and that if you speak to your NSC, then i'm sure that they can do this minor task for you ??Remember: Keep it simple0
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