05 July 2018

D365: AX 7: Delegate - How to create and use delegate in Dynamics 365

D365: AX 7: Delegate - How to create and use delegate in Dynamics 365
How to return value in Deligate and Event handler methods.

class TestPrintMgmtDelegateHandler
{
///
///
///

/// /// [SubscribesTo(classStr(PrintMgmtDocType), delegateStr(PrintMgmtDocType, getDefaultReportFormatDelegate))]
public static void PrintMgmtDocType_getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)
{
if (_result.result() != null)
return;

_result.result(VCPrintMgmtDelegateHandler::getDefaultReportFormat(_docType));
}

///
///
///

private static PrintMgmtReportFormatName getDefaultReportFormat(PrintMgmtDocumentType _docType)
{
#ISOCountryRegionCodes

switch(_docType)
{
case PrintMgmtDocumentType::SalesOrderInvoice:
if(SysCountryRegionCode::isLegalEntityInCountryRegion([#isoTH]))
{
return ssrsReportStr(VCDeliveryReport, Report);
}
}
return ssrsReportStr(SalesInvoice, Report);;
}

}

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...