To add new print management option "Picking list label" in AR->setup-> Forms->form setup -> print management
element.createPickingLabelPrintMgmtDocInstance(); [after the super. Refer below for the method]
Add new element InventPickListLabel, label "Picking list label"
method(): getDocumentTypes
Add the following code after the docTypes.addEnd(PrintMgmtDocumentType::InventPickList);
docTypes.addEnd(PrintMgmtDocumentType::InventPickListLabel);
method: getQueryTableId(), getQueryRangeFields()
Add Case: PrintMgmtDocumentType::InventPickListLabel to existing case
PrintMgmtDocumentType::InventPickList.
\Forms\CustFormletterParameters\Designs\Design\[Tab:Tab]\[TabPage:General]\[Group:ButtonGroup]\Button:PrintMgmt\Methods\clicked
Add this after the inventDocs.addEnd for InventPickList
inventDocs.addEnd(PrintMgmtDocumentType::InventPickListLabel);
void createPickingLabelPrintMgmtDocInstance()
{
PrintMgmtDocInstance printMgmtDocInstance;
RecId recId = 0;
tableId tableId = 0;
;
if (PrintMgmtDocInstance::exist(recId,tableId,PrintMgmtNodeType::Invent,PrintMgmtDocumentType::InventPickListLabel,1) )
return;
ttsbegin;
printMgmtDocInstance.selectForUpdate(true);
printMgmtDocInstance.clear();
printMgmtDocInstance.PrintType = PrintMgmtDocInstanceType::Original;
printMgmtDocInstance.Name = "";
printMgmtDocInstance.PriorityId = 1;
printMgmtDocInstance.DocumentType = PrintMgmtDocumentType::InventPickListLabel;
printMgmtDocInstance.ReferencedRecId = recId;
printMgmtDocInstance.ReferencedTableId = tableId;
printMgmtDocInstance.NodeType = PrintMgmtNodeType::Invent;
printMgmtDocInstance.Suppress = NoYes::No;
printMgmtDocInstance.insert();
printMgmtDocInstance.selectForUpdate(true);
printMgmtDocInstance.clear();
printMgmtDocInstance.PrintType = PrintMgmtDocInstanceType::Copy;
printMgmtDocInstance.Name = "@SYS92837";
printMgmtDocInstance.PriorityId = 2;
printMgmtDocInstance.DocumentType = PrintMgmtDocumentType::InventPickListLabel;
printMgmtDocInstance.ReferencedRecId = recId;
printMgmtDocInstance.ReferencedTableId = tableId;
printMgmtDocInstance.NodeType = PrintMgmtNodeType::Invent;
printMgmtDocInstance.Suppress = NoYes::No;
printMgmtDocInstance.insert();
ttscommit;
}
Create a new class which is duplicate of SalesFormLetterReport_PickingList();
modify the method getPrintMgmtDocumentType() to return InventPickListLabel
modify the method getPrintMgmtNodeType to return only PrintMgmtNodeType::Invent;
method: construct()
Add the following case;
case PrintMgmtDocumentType::InventPickListLabel:
return new SalesFormLetterReport_PickingListLabel();
Ex: WMSPickingList_OrderPick Report: Init method
use salesFormLetterReport = FormLetterReport::construct(PrintMgmtDocumentType::InventPickListLabel)
instead of salesFormLetterReport = FormLetterReport::construct(PrintMgmtDocumentType::InventPickList)
Add the following lines after super()
printCopyOriginal = PrintCopyOriginal::OriginalPrint;
this.report().interactive(false);
hideDialog = true;
salesFormLetterReport = FormLetterReport::construct(PrintMgmtDocumentType::InventPickListLabel);
salesFormLetterReport.parmReportDesign(element);
salesFormLetterReport.parmPrintType(printCopyOriginal);
salesFormLetterReport.parmUsePrintMgmtDestinations(true);
hidePrinterSelect = true;
add the following code in the fetch method
Common referencedTable;
referencedTable = null;
salesFormLetterReport.loadPrintSettings(
wmsPickingRoute,
referencedTable,
CompanyInfo::find().LanguageId);
while (salesFormLetterReport.moveNextPrintSetting())
{
// Set report print settings
element.unpackPrintJobSettings(salesFormLetterReport.getCurrentPrintSetting().parmPrintJobSettings().packPrintJobSettings());
element.printJobSettings().copies(salesFormLetterReport.getCurrentPrintSetting().parmNumberOfCopies());
//relevant send methods
}
Monday, August 24, 2009
Add new print management option in Ax 2009
Subscribe to:
Posts (Atom)