Report.RunModal seems to be dropping the record parameter

manthano
Member Posts: 10
I'm passing a record to the report, but it seems to get dropped. Not sure why?? Here is the code from the debugger.
OnPush Code
PrintRecords Function in SalesCrMemoHeader
Any ideas as to what the matter is with this code? I believe the majority of it is standard Navision, with the exception of the conditional report selection. When the report request form comes up the No. filter is blank. Thanks!
OnPush Code
CurrForm.SETSELECTIONFILTER(SalesCrMemoHeader); SalesCrMemoHeader.COPY(Rec); SalesCrMemoHeader.PrintRecords(TRUE)
PrintRecords Function in SalesCrMemoHeader
WITH SalesCrMemoHeader DO BEGIN COPY(Rec); IF "Shortcut Dimension 1 Code" = 'CONDITION A' THEN ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Cr.Memo") ELSE IF "Shortcut Dimension 1 Code" = 'CONDITION B' THEN ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Cr.Memo(B)"); ReportSelection.SETFILTER("Report ID",'<>0'); ReportSelection.FIND('-'); REPEAT REPORT.RUNMODAL(ReportSelection."Report ID",ShowRequestForm,FALSE,SalesCrMemoHeader); UNTIL ReportSelection.NEXT = 0; END;
Any ideas as to what the matter is with this code? I believe the majority of it is standard Navision, with the exception of the conditional report selection. When the report request form comes up the No. filter is blank. Thanks!
0
Comments
-
Try to not use the "WITH" command. Are you sure, that nav will represent the code
COPY(Rec);
correctly asSalesCrMemoHeader.COPY(Rec);
???0 -
Based on the debugger, the Report.RunModal function is filled with all the correct values. But I will try your suggestion. Thanks.
Edit: Tried doing it without using WITH. No difference. Thanks again for trying though.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