Tuesday, May 9, 2023

Get ER format mapping from Print management destination setting in D365FO X++

ERFormatMappingId                   formatMapping;

 str defaultReportName = PrintMgmtDocType::construct(PrintMgmtDocumentType::SAN_CommercialInvoice).getDefaultReportFormat();

        if(defaultReportName)

        {

            int prefixLength = strLen(ERPrintMgmtSetupUISettingsCtlEventHandler::PrintManagementFormatPrefix);

            var formatGuid = str2Guid(subStr(defaultReportName, prefixLength + 1, strLen(defaultReportName) - prefixLength));


            formatMapping = ERFormatMappingTable::findByGUID(formatGuid).RecId;

        }

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...