Posting Date Error
Hey Guys,
i'm trying to build a report to sum the invoiced quantities and revenues by customer PER YEAR.
I created this CAL Globals (for year 2016)

CAL CODE:
OnPreReport()
Date2016_Start := 010116D;
Date2016_End := 311216D;
//WP2.RESET;
//WP2.SETRANGE("Posting Date",Date2016_Start,Date2016_End);
//WP2.SETRANGE("Source No.", Customer."No.");
//WP2.CALCSUMS("Sales Amount (Actual)");
//WP2.CALCSUMS("Invoiced Quantity");
//Umsatz_2016 :=WP2."Sales Amount (Actual)";
//Menge_2016 :=WP2."Invoiced Quantity";
I don't get an errormessage when I compile the report, but the report shows the wrong values.
PAGE.RUNMODAL on value entry table shows, that the datefilter isn't set.
pls help
i'm trying to build a report to sum the invoiced quantities and revenues by customer PER YEAR.
I created this CAL Globals (for year 2016)

CAL CODE:
OnPreReport()
Date2016_Start := 010116D;
Date2016_End := 311216D;
//WP2.RESET;
//WP2.SETRANGE("Posting Date",Date2016_Start,Date2016_End);
//WP2.SETRANGE("Source No.", Customer."No.");
//WP2.CALCSUMS("Sales Amount (Actual)");
//WP2.CALCSUMS("Invoiced Quantity");
//Umsatz_2016 :=WP2."Sales Amount (Actual)";
//Menge_2016 :=WP2."Invoiced Quantity";
I don't get an errormessage when I compile the report, but the report shows the wrong values.
PAGE.RUNMODAL on value entry table shows, that the datefilter isn't set.
pls help
0
Best Answer
-
Hey p0wertube,
you set the Filter in the OnPreReport() section?
Set it in the OnPreDataItem section and it should work.5
Answers
-
Hey p0wertube,
you set the Filter in the OnPreReport() section?
Set it in the OnPreDataItem section and it should work.5 -
Thanks Aluan, that worked!!!!!
0 -
Another question.
We changed from our old ERP-system to NAV in the middle of 2017.
No I'm trying to add up the sales qty from the old system (where quantities are positive) and the invoiced qty from the value entry. (qty is negative)
that causes that the old qty (f.e.40 pcs) and the new qty (f.e. -20pcs) brings a total qty of 20 instead of 60.
I've found this code piece, but it doesnt work:
WP2."Invoiced Quantity" := -WP2."Invoiced Quantity";0 -
Are the old and new values in the same field & table?
The '-' in your example does the following:
Example:
WP2."Invoiced Quantity" = 5;
WP2."Invoiced Quantity" := -WP2."Invoiced Quantity";
Result: -5
WP2."Invoiced Quantity" = -5;
WP2."Invoiced Quantity" := -WP2."Invoiced Quantity";
Result: 50
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
- 611 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