Page 143 - Action 20 --> Print!?!

ceccomil
Member Posts: 25
Hi EveryBody
I just made a new report for printing "proforma invoice", so a decided to add an action in the "sales invoice list" for printing my report. I've added my action and everything works on, but when I click my print button, in the request page I have to select the number of the invoice I want to print (leave it blank will print the entire list).
Rememberring what appens on printing posted invoices (if you don't specify any number only the selected invoice will be printed) i took a look to the page 143 "Posted Sales Invoices".
Surprise!! In the action 20 (Print) "RunObject" field it's "Undefined" and I can't understand how it works...
How can I get the same behaviour for my report?
I just made a new report for printing "proforma invoice", so a decided to add an action in the "sales invoice list" for printing my report. I've added my action and everything works on, but when I click my print button, in the request page I have to select the number of the invoice I want to print (leave it blank will print the entire list).
Rememberring what appens on printing posted invoices (if you don't specify any number only the selected invoice will be printed) i took a look to the page 143 "Posted Sales Invoices".
Surprise!! In the action 20 (Print) "RunObject" field it's "Undefined" and I can't understand how it works...
How can I get the same behaviour for my report?
0
Comments
-
Hi!
There is no surprise, just c/al code.
Press F9 key and look at the code in <Action20> - OnAction() trigger.
Good luck.0 -
my C/AL Code menu it's disable!!! in pages
... I think it's a license I'll try with my technet license instead of the company license
0 -
OK.
There is a c/al code:<Action20> - OnAction() CurrPage.SETSELECTIONFILTER(SalesInvHeader); SalesInvHeader.PrintRecords(TRUE);
As you can see this action call function PrintRecords from table 112 Sales Invoice Header, not report.
Here is a listing of PrintRecords function:PrintRecords(ShowRequestForm : Boolean) WITH SalesInvHeader DO BEGIN COPY(Rec); FIND('-'); ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Invoice"); ReportSelection.SETFILTER("Report ID",'<>0'); ReportSelection.FIND('-'); REPEAT REPORT.RUNMODAL(ReportSelection."Report ID",ShowRequestForm,FALSE,SalesInvHeader); UNTIL ReportSelection.NEXT = 0; END;
It means that for every record in table Report Selection with field Usage = S.Invoice system will call linked report.
You can add your report to this table:
In RTC: Departments/Administration/Application Setup/Sales & Marketing/Sales/Report Selection Sales
Select Invoice option from Usage list.
Add your report.
Now if you click Print Action system propose you to print both reports (the old one, and than your report).0 -
Thanks for your reply my problem it's I need to print invoice as "Proforma" from the Sales Header not from the "Sales Invoice Header" which are already posted.
Unfortunately with my license (Company end user) I can't access to the C/AL code of the pages...
Really I think the solution it's very simple.. just add an action in the process section of Invoice List page then put this 2 lines of code and a variable (SalesHeader which is "Sales Header" record)CurrPage.SETSELECTIONFILTER(SalesHeader); REPORT.RUNMODAL(REPORT::ProformaInvoice,TRUE,TRUE,SalesHeader);
I think I need to upgrade my professional msdn subscription to Premium... :-#0 -
ceccomil wrote:Thanks for your reply my problem it's I need to print invoice as "Proforma" from the Sales Header not from the "Sales Invoice Header" which are already posted.
Unfortunately with my license (Company end user) I can't access to the C/AL code of the pages...
Really I think the solution it's very simple.. just add an action in the process section of Invoice List page then put this 2 lines of code and a variable (SalesHeader which is "Sales Header" record)CurrPage.SETSELECTIONFILTER(SalesHeader); REPORT.RUNMODAL(REPORT::ProformaInvoice,TRUE,TRUE,SalesHeader);
I think I need to upgrade my professional msdn subscription to Premium... :-#
Print action works same way for Sales Header and Sales Invoice Header etc.
Select appropriate option from Usage list, for example you can select option Order.
May be you should think about Application Builder granule.0 -
[Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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