Document No. on Gen. Jnl. Line
Verndroid
Member Posts: 18
Hi
We recently had support case where a client suddenly had a bunch of Genereal Journal Lines lose their Account No.'s. The culprit is the following code on Table 81 that is called in the OnDelete Trigger (among others).
Scenario is as follows:
A user enters a number of lines in the Cash Receipt journal. All lines have the same Document No. They are of Document type Payment. As it happens the user also enters a Refund line that is applied to a previously posted payment with the same documentno.. So Applies-to Doc. Type is "Payment". "Applies-to Doc. No." is the same Document No. as other payments in the same journal.
Yo and behold. User comes back 10 minutes later. Figures.. nah.. I don't want that refund line in the journal. Then proceeds to delete the Refund line.
The above code now alters all other lines in the journal. Setting Accont Type to G/L Account (Was customer) and Account No. to '' ...
Why is he using the same Document No. I hear you all say. Well. he just happens to want it that way and nothing is preventing him from doing it. But after deleting that one Refund an entire days work (potentially) is lost.
Anyone know why Microsoft decided to add that piece of code and how it got through QA?
We recently had support case where a client suddenly had a bunch of Genereal Journal Lines lose their Account No.'s. The culprit is the following code on Table 81 that is called in the OnDelete Trigger (among others).
ClearAppliedGenJnlLine() IF "Applies-to Doc. No." = '' THEN EXIT; GenJournalLine.SETRANGE("Journal Template Name","Journal Template Name"); GenJournalLine.SETRANGE("Journal Batch Name","Journal Batch Name"); GenJournalLine.SETFILTER("Line No.",'<>%1',"Line No."); GenJournalLine.SETRANGE("Document Type","Applies-to Doc. Type"); GenJournalLine.SETRANGE("Document No.","Applies-to Doc. No."); GenJournalLine.MODIFYALL("Applied Automatically",FALSE); GenJournalLine.MODIFYALL("Account Type",GenJournalLine."Account Type"::"G/L Account"); GenJournalLine.MODIFYALL("Account No.",'');
Scenario is as follows:
A user enters a number of lines in the Cash Receipt journal. All lines have the same Document No. They are of Document type Payment. As it happens the user also enters a Refund line that is applied to a previously posted payment with the same documentno.. So Applies-to Doc. Type is "Payment". "Applies-to Doc. No." is the same Document No. as other payments in the same journal.
Yo and behold. User comes back 10 minutes later. Figures.. nah.. I don't want that refund line in the journal. Then proceeds to delete the Refund line.
The above code now alters all other lines in the journal. Setting Accont Type to G/L Account (Was customer) and Account No. to '' ...
Why is he using the same Document No. I hear you all say. Well. he just happens to want it that way and nothing is preventing him from doing it. But after deleting that one Refund an entire days work (potentially) is lost.
Anyone know why Microsoft decided to add that piece of code and how it got through QA?
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
- 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