Sorting a Report by Document Date

d7ono
Member Posts: 6
I have a report already written but I cannot sort by Document Date (ascending), tried adding a key but it throws up an error.
The vendor ledger entry table does not have an active key that starts with the following field(s) Document Date.
Could I write a piece of code in the C/AL (getafterrecord) to resolve this instead of adding a key ?
If so can you help with the actual wording of the code.
(My report is based on Vendor table with vendor ledger entry indented under if that helps)
The vendor ledger entry table does not have an active key that starts with the following field(s) Document Date.
Could I write a piece of code in the C/AL (getafterrecord) to resolve this instead of adding a key ?
If so can you help with the actual wording of the code.
(My report is based on Vendor table with vendor ledger entry indented under if that helps)
0
Comments
-
Could you provide us with the error that nav throws when you add the key.
It could save you a lot of code.
You can try to define the DataItemTableView in the properties of the dataitem in your report.
TrySorting("Document Date")
Just select the Dataitem in your report designer and press Shift + F4 to view the properties.0 -
Sog wrote:Could you provide us with the error that nav throws when you add the key.
It could save you a lot of code.
You can try to define the DataItemTableView in the properties of the dataitem in your report.
TrySorting("Document Date")
Just select the Dataitem in your report designer and press Shift + F4 to view the properties.
Hi
Tried above comes up with the same message
"The vendor ledger entry table does not have an active key that starts with the following field(s) Document Date."0 -
What error do you receive when you try to add the key to the vendor ledger entry table?
Because it is very odd that that doesn't work.
Sorting on a non key field in code can be very hard because a report steps trough the filtered and sorted table record for record. And when I think about it, it seems impossible to do (but I have to admit that I'm no NAV expert).0 -
depending on your needs, you can create a temptable variable for vendor ledger entries, copy the document date in the posting date of the temptable, modifyall and order the temptable by posting date.
then show the temptable...I hope you're a developer0 -
Belias wrote:depending on your needs, you can create a temptable variable for vendor ledger entries, copy the document date in the posting date of the temptable, modifyall and order the temptable by posting date.
then show the temptable...I hope you're a developer0 -
DaveT wrote:Belias wrote:depending on your needs, you can create a temptable variable for vendor ledger entries, copy the document date in the posting date of the temptable, modifyall and order the temptable by posting date.
then show the temptable...I hope you're a developer
Right, this is the meaning ofI hope you're a developer0
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