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.
SGM
0
Comments