... addAX(PrintMgmtDocumentType::PurchaseOrderConfirmationRequest); addAX(PrintMgmtDocumentType::VKBankPaymAdvice); // Solution MOD ...
// basically a modified copy of BankPaymAdviceVendController extending SrsPrintMgmtController class VKBankPaymAdviceVendController extends SrsPrintMgmtController ... SRSPrintDestinationSettings printDestinationSetting; container printerSetting; ...
protected void initPrintMgmtReportRun() { UsePrintMgmt paymAdvUsePrintMgmt; paymAdvUsePrintMgmt = this.parmArgs().parmEnum(); printMgmtReportRun=PrintMgmtReportRun::construct( PrintMgmtHierarchyType::Purch, PrintMgmtNodeType::VKBankPaymAdvice, PrintMgmtDocumentType::VKBankPaymAdvice ); printMgmtReportRun.parmForcePrintJobSettings(!paymAdvUsePrintMgmt); printMgmtReportRun.parmReportRunController(this); }
... bankPaymAdviceVendTmp.PaymAdviceDate = systemDateGet(); bankPaymAdviceVendTmp.PaymentReference = paymref; BankPaymAdviceVendTmp.VKVendAccount = VendTable.AccountNum; // Solution MOD ...
protected void preRunModifyContract() { Query reportQuery; reportQuery = this.parmReportContract().parmQueryContracts().lookup(this.getFirstQueryContractKey()); SrsReportHelper::addParameterValueRangeToQuery( reportQuery, tableNum(BankPaymAdviceVendTmp), fieldNum(BankPaymAdviceVendTmp,SessionId), this.currentSessionId() ); }
// Solution MOD BEGIN // variable declaration section Map vendorMap = new Map(Types::Int64, Types::Int64); MapEnumerator me; // Solution MOD END ... currentSessionId = new xSession().sessionId(); // Solution MOD BEGIN /* The right way would be to introduce completely new SessionId field based on guid for example and generate new guid for each vendor. But it will require update of report metadata. It is not possible to merge ssrs report changes and it will be a pain for future. Therefore existing integer field will be used to devide reports. */ currentSessionId = currentSessionId*100000; // Solution MOD END ... li = paramOutPaymlist.getEnumerator(); while (li.moveNext()) { ... vendTable = VendTable::findByCompany(vendOutPaymRecord.parmCustVendPaym().ledgerJournalTrans().Company, vendOutPaymRecord.parmCustVendPaym().ledgerJournalTrans().parmAccount()); // Solution MOD BEGIN // We need to make sure that SessionId is unique for each vendor and will delete previous records. // The delete statement above does not suit, in wrong possition, but still required to delete old data. if (vendorMap.exists(vendTable.RecId)) { currentSessionId = vendorMap.lookup(vendTable.RecId); } else { currentSessionId++; delete_from bankPaymAdviceVendTmp where bankPaymAdviceVendTmp.SessionId == currentSessionId; vendorMap.insert(vendTable.RecId, currentSessionId); } // Solution MOD END this.setPaymReferenceStr(); ... } // Solution MOD BEGIN // At the end of the method if (vendorMap.elements()) { // print data per vendor me = vendorMap.getEnumerator(); while (me.moveNext()) { currentSessionId = me.currentValue(); select firstOnly BankPaymAdviceVendTmp where BankPaymAdviceVendTmp.SessionId == currentSessionId; if (BankPaymAdviceVendTmp) { this.initPrintMgmtReportRun(); printMgmtReportRun.load(BankPaymAdviceVendTmp, BankPaymAdviceVendTmp, CompanyInfo::languageId()); this.outputReports(); } } } // Solution MOD END }
protected void runPrintMgmt() { vendOutPaym = this.parmArgs().caller(); vendOutPaymList = this.parmArgs().parmObject(); this.processReport(vendOutPaymList); }
public static void main(Args _args) { SrsPrintMgmtController controller = new VKBankPaymAdviceVendController(); controller.parmReportName(#ReportName); controller.parmArgs(_args); controller.parmShowDialog(false); controller.startOperation(); }
... case PrintMgmtDocumentType::PurchRFQReturn: return ssrsReportStr(RFQSend, Report); // Solution MOD BEGIN case PrintMgmtDocumentType::VKBankPaymAdvice: return ssrsReportStr(BankPaymAdviceVend, Report); // Solution MOD END case PrintMgmtDocumentType::SalesOrderInvoice: ...
... case PrintMgmtDocumentType::PurchaseOrderConfirmationRequest: case PrintMgmtDocumentType::VKBankPaymAdvice: // Solution MOD return PrintMgmtPrintDestinationPartyType::Vendor; ...
... tableId = tableNum(VendRFQJour); break; // Solution MOD BEGIN case PrintMgmtDocumentType::VKBankPaymAdvice: tableId = tableNum(BankPaymAdviceVendTmp); break; // Solution MOD END case PrintMgmtDocumentType::SalesOrderInvoice, ...
... docTypes.addEnd(PrintMgmtDocumentType::PurchRFQReject); docTypes.addEnd(PrintMgmtDocumentType::PurchRFQReturn); docTypes.addEnd(PrintMgmtDocumentType::VKBankPaymAdvice); // Solution MOD } ...
... docTypes.addEnd(PrintMgmtDocumentType::PurchRFQReject); docTypes.addEnd(PrintMgmtDocumentType::PurchRFQReturn); docTypes.addEnd(PrintMgmtDocumentType::VKBankPaymAdvice); // Solution MOD } ...
... supportedNodes.addEnd(PrintMgmtNodeType::PurchAgreement); supportedNodes.addEnd(PrintMgmtNodeType::VKBankPaymAdvice); // Solution MOD ...
... PurchAgreementHeader purchAgreementHeader; BankPaymAdviceVendTmp bankPaymAdviceVendTmp; // Solution MOD // <GEEU> ... case PrintMgmtNodeType::Purch: // When no parent is present, return null result = null; break; // Solution MOD BEGIN case PrintMgmtNodeType::VKBankPaymAdvice: BankPaymAdviceVendTmp = _nodeInstance.parmReferencedTableBuffer(); if (BankPaymAdviceVendTmp.VKVendAccount) { result.parmReferencedTableBuffer(BankPaymAdviceVendTmp.selectRefRecord(fieldnum(BankPaymAdviceVendTmp, VKVendAccount))); } else { result.parmReferencedTableBuffer(null); } result.parmNodeDefinition(PrintMgmtNode::construct(PrintMgmtNodeType::VendTable)); break; // Solution MOD END } return result; }
... case PrintMgmtNodeType::TMS: return new TMSPrintMgmtNode_TMS(); // Solution MOD BEGIN case PrintMgmtNodeType::VKBankPaymAdvice: return new PrintMgmtNode_VKBankPaymAdvice(); // Solution MOD END }
class PrintMgmtNode_VKBankPaymAdvice extends PrintMgmtNode { } protected str getDisplayCaptionImplementation(Common _tableBuffer) { return(strfmt("@SYS108944", _tableBuffer.caption())); } public List getDocumentTypes() { List docTypes; docTypes = new List(Types::Enum); if (isConfigurationkeyEnabled(configurationkeynum(LogisticsBasic))) { docTypes.addEnd(PrintMgmtDocumentType::VKBankPaymAdvice); } return docTypes; } public int getIconImageResNum() { #resAppl return #ImagePrintManagementTrans; } public PrintMgmtNodeType getNodeType() { return PrintMgmtNodeType::VKBankPaymAdvice; } public RefTableId getReferencedTableId() { return tablenum(BankPaymAdviceVendTmp); }
... // Solution MOD BEGIN DialogField paymAdviceUsePrintMgmt; UsePrintMgmt paymAdvUsePrintMgmt; // Solution MOD END #DEFINE.CurrentVersion(1) #LOCALMACRO.CurrentList numRecords, numAmount, currencyList, amountList ,paymAdvUsePrintMgmt // Solution MOD #ENDMACRO
... paymAdviceUsePrintMgmt = dialog.addfieldvalue(enumStr(NoYes), NoYes::Yes, "@SYS93922"); // Solution MOD return dialog; }
public boolean getFromDialog() { ; paymAdvUsePrintMgmt = paymAdviceUsePrintMgmt.value(); // Solution MOD return super(); }
public void printPaymAdvice() { Args args = new Args(); args.caller(this); args.parmObject(this.getOutPaymRecords()); // Solution MOD BEGIN args.parmEnumType(enumNum(NoYes)); args.parmEnum(paymAdvUsePrintMgmt); if (paymAdvUsePrintMgmt) { new MenuFunction(menuitemOutputStr(VKBankPaymAdviceVend), MenuItemType::Output).run(args); } else { new MenuFunction(menuitemOutputStr(BankPaymAdviceVend), MenuItemType::Output).run(args); } // Solution MOD END }
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.
Authors are allowed to set their own AdSense units.
Join us.