Entering journal lines in a filtered recordset
Bokk
Member Posts: 138
I am new to Navision development and have run into a problem entering data into a journal when there is a filter. I have made some modifications to use the Job journal for timesheet entry. I have added a filter in code to only show journal lines based on the login USERID (so that employees only see their own entries). However, unless an individual's last entry in the filtered set is also the last entry in the table, they receive a duplicate key error message. (This also happens when a filter is set by the user.) In OnNewRecord, xRec of the form is sent into the SetupNewLine function of the journal table as the LastJobJournalLine. I tried sending in a global rec variable of the Job Journal Line, but it seems to be overwritten. I followed in debug and the Line No. appears to stay at 0 through the validation and changes to the next Line No. based on the filtered set in the OnInsert trigger, seemingly when LOCKTABLE occurs. I am wondering why the last line no. is based on the filtered set and where to affect it to grab that from the whole table instead.
Sorry my question is so long.
Sorry my question is so long.
SGM
0
Comments
-
Why don't you use batches to accomplish this task. Make a batch for every user.0
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
- 322 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