Report - Posting Routine Looping

NormajmNormajm 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!

Comments

Sign In or Register to comment.