This topic shows how to customize Microsoft Dynamics AX 2012 to allow users printing multiple invoices simply by selecting them and directly sending them to the printer, instead of printing them one by one.
هذا المقال يشرح طريقة تعديل برنامج AX 2012 ليسمح بتحديد عدد كبير من الفواتير و إرسالها مباشرة للطابعة بدلا من طباعتها واحدة تلو الأخرى.
The following Video contains all the steps for customizing the invoice journal screen of the AR module:
الفيديو التالي يشرح خطوات تعديل شاشة الفواتير لتقوم بتلك المهمة:
The code used for such customization is as follows:
الكود المستخدم هو كالتالي:
//1) Add the following function to the methods of the "Use print management" menu item of the "Invoice Journal" Inguiry Screen.....................................Public void PrintSingleInvoice(RecId _RecId){PrintJobSettings printJobSettings = new PrintJobSettings();SalesInvoiceJournalPrint salesInvoiceJournalPrint;Set set = new Set(Types::Record);SRSPrintDestinationSettings srsPrintDestinationSettings;// Add recordset.add(CustInvoiceJour::findRecId(_RecId));// Set printer settingssrsPrintDestinationSettings = new SRSPrintDestinationSettings();srsPrintDestinationSettings.printMediumType(SRSPrintMediumType::Printer);srsPrintDestinationSettings.numberOfCopies(1);srsPrintDestinationSettings.printerName(printJobSettings.deviceName());// InitalizesalesInvoiceJournalPrint = SalesInvoiceJournalPrint::construct();salesInvoiceJournalPrint.parmPrintFormletter(NoYes::Yes);salesInvoiceJournalPrint.parmUsePrintManagement(false);salesInvoiceJournalPrint.parmPrinterSettingsFormLetter(srsPrintDestinationSettings.pack());salesInvoiceJournalPrint.printJournal(set);}//2) modify the clicked method of the "Use print management" menu item of the "Invoice Journal" Inguiry Screen as follows:.........................................//21) Comment the following line..//new MenuFunction(menuitemOutputStr(SalesInvoice), MenuItemType::Output).run(args);//22) Add the following Line:this.PrintSingleInvoice(custInvoiceJourLocal.RecId);