Calc and Post VAT Settlement

maca
Member Posts: 6
On 2 customer sites
in NAV 2016 unmodified VAT Entry Table and Calc and Post VAT Settlement
Last quarter both ran in circa 5 minutes however this Quarter both seem to be hanging when the report modifies the VAT Entry table (closed, closed by entry no.) where the dataset > 10000 records
In Preview mode on both customer system it displays in < 1minute
On 1 site there was a SQL update.
I can only think it's a SQL issue, as it's standard NAV and has been working fine. but not sure where to start.
in NAV 2016 unmodified VAT Entry Table and Calc and Post VAT Settlement
Last quarter both ran in circa 5 minutes however this Quarter both seem to be hanging when the report modifies the VAT Entry table (closed, closed by entry no.) where the dataset > 10000 records
In Preview mode on both customer system it displays in < 1minute
On 1 site there was a SQL update.
I can only think it's a SQL issue, as it's standard NAV and has been working fine. but not sure where to start.
0
Best Answer
-
Decided to refactor the code so it now only locks the G/L entry table for < 1min. Not really the solution but..
0
Answers
-
Decided to refactor the code so it now only locks the G/L entry table for < 1min. Not really the solution but..
0 -
Hi maca, could you please share the changes you have made, I am also experiencing similar issue.
thanks0 -
Basically the issue was the modifyall statement, so I put the vat entries that needed to be updated in a temp table and then updated them at the end of the process. Notice the commits, I don't like it, but solved the problem.
Example
At the end of 'Close VAT Entries'- OnAfterGetRecord
// Close current VAT entries
IF PostSettlement THEN BEGIN
VATEntry.FINDSET;
REPEAT
T_VATEntry := VATEntry;
T_VATEntry."Closed by Entry No." := NextVATEntryNo;
T_VATEntry.INSERT;
UNTIL VATEntry.NEXT = 0;
//VATEntry.MODIFYALL("Closed by Entry No.",NextVATEntryNo); //Orig Line
//VATEntry.MODIFYALL(Closed,TRUE); //Orig Line
END;
And then 'OnPostReport'
//AM 19.03.17+
IF NOT T_VATEntry.FINDSET THEN
EXIT;
COMMIT;
TotRecs := T_VATEntry.COUNT;
@1@'); //progress window, code not displaying properly
REPEAT
L_VATEntry.GET(T_VATEntry."Entry No.");
L_VATEntry."Closed by Entry No." := T_VATEntry."Closed by Entry No.";
L_VATEntry.Closed := TRUE;
L_VATEntry.MODIFY;
I += 1;
IF I MOD 100 = 0 THEN BEGIN
Window.UPDATE(1,ROUND(I/TotRecs*10000,1));
COMMIT;
END;
UNTIL T_VATEntry.NEXT = 0;
Window.CLOSE;
MESSAGE('Finished');
//AM 19.03.17-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