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

DB restore production DB to DEV environment in D365 FO using Bacpac file

  https://www.linkedin.com/pulse/restore-production-database-dev-environment-d365fo-using-abbas-tfwbe SQLPackage link : https://www.linkedin...