Filter on GUID
fve
Member Posts: 28
Hi,
I would like to know if it's possible to set a filter on a GUID-field in a table.
I have created a table with a GUID-field.
I use this table in a report.
In the OnInitReport-trigger, I call the function CREATEGUID().
Then I write records to the table above with the GUID as one of the fields.
Then, in a new dataitem, I perform a SETRANGE on the GUID in the OnPreDataItem-trigger, in order to filter only the records added to the table in this particular run of the report.
Unfortunately, this leaves me with an empty report.
If I remove the SETRANGE on the GUID in the OnPreDataItem-trigger, the report runs correctly. The only problem I have, is that multiple users can run this report at the same time, so data is mixed up. I don't see another solution than using the GUID to solve this problem.
Any help is appreciated.
I would like to know if it's possible to set a filter on a GUID-field in a table.
I have created a table with a GUID-field.
I use this table in a report.
In the OnInitReport-trigger, I call the function CREATEGUID().
Then I write records to the table above with the GUID as one of the fields.
Then, in a new dataitem, I perform a SETRANGE on the GUID in the OnPreDataItem-trigger, in order to filter only the records added to the table in this particular run of the report.
Unfortunately, this leaves me with an empty report.
If I remove the SETRANGE on the GUID in the OnPreDataItem-trigger, the report runs correctly. The only problem I have, is that multiple users can run this report at the same time, so data is mixed up. I don't see another solution than using the GUID to solve this problem.
Any help is appreciated.
0
Answers
-
It is better to use temptables for the report. With temptables you don't write to the real DB, but keep it in memory, so it is faster and if users use the same report at the same time, they don't interfere.
See http://www.mibuso.com/howtoinfo.asp?FileID=6 for reports based on a temptable.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
And if you still need the real table inserts, please, post your code for the setrange...0
-
Or even better:use the session id (that is an integer):kine wrote:And if you still need the real table inserts, please, post your code for the setrange...recSession.RESET; recSession.SETRANGE("My Session",TRUE); recSession.FIND('-'); MESSAGE('%1',recSession."Connection ID");Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thank you for all the replies.
I managed to get it working with the temp. table!
Thank you all for your help!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
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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
