Report - Posting Routine Looping
Normajm
Member Posts: 82
I created a new report that calls a posting report. However, it doesn't work. It just keeps looping and I have to cancel NAV using task manager.
Here is the code I tried...
Sales Header - OnAfterGetRecord()
SalesHdr.SETCURRENTKEY("No.");
If (SalesHdr."Order Category" = 'Phone') and (SalesHdr."Package Exists" = True) Then
SalesHdr.SetFilter("Order Category",'Phone');
SalesHdr.SetFilter("Package Exists", 'Yes');
Report50056.SETTABLEVIEW(SalesHdr);
Report50056.RUN
It opens a blank sales header filter window, I select preview. It opens the posting window with just the Package Exists field filled in with "Yes". I still need to fill in Order Category, the goal is for it to autofill like the Package exists field does. Then when I select post, it just keeps repeating the posting window and I have to end task to get it to stop.
NAV 2015 - report 50056 is a copy of 297. No changes to it at this time.
Help!
Here is the code I tried...
Sales Header - OnAfterGetRecord()
SalesHdr.SETCURRENTKEY("No.");
If (SalesHdr."Order Category" = 'Phone') and (SalesHdr."Package Exists" = True) Then
SalesHdr.SetFilter("Order Category",'Phone');
SalesHdr.SetFilter("Package Exists", 'Yes');
Report50056.SETTABLEVIEW(SalesHdr);
Report50056.RUN
It opens a blank sales header filter window, I select preview. It opens the posting window with just the Package Exists field filled in with "Yes". I still need to fill in Order Category, the goal is for it to autofill like the Package exists field does. Then when I select post, it just keeps repeating the posting window and I have to end task to get it to stop.
NAV 2015 - report 50056 is a copy of 297. No changes to it at this time.
Help!
0
Comments
-
Hi @Normajm.
You'll need to set SalesHdr.Filtergroup(2) and then pass it to the report for the filters to get through. At the end don't forget to reset the filtergoup (SalesHdr.Filtegroup(0)).
Check this for more info: https://docs.microsoft.com/en-us/dynamics-nav/filtergroup-function--record-1 -
Thanks the filtergroup function worked for getting all the filters in as needed.0
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
- 610 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
