D365FO – AX – Copy attachments from Project quotations (SalesQuotationTable) to new or existsing Project (ProjTable) while using “Transfer to project” functionality

We want to copy attachments from Project quotation table to new or existsing project from "Transfer to project" functionality Create an extension of SalesQuotationProjLinkWizard class [ExtensionOf(classStr(SalesQuotationProjLinkWizard))] Create a final class final class Al0SalesQuotationProjLinkWizard_Extension { .............. } Create "al0CopyAttachmentsQuotationToProject" custom method. This method retreieve attachments from SalesQuotationTable to ProjTable. private void al0CopyAttachmentsQuotationToProject(RecId _SalesQuotationRecId, RecId _ProjTableId) { … Continua a leggere D365FO – AX – Copy attachments from Project quotations (SalesQuotationTable) to new or existsing Project (ProjTable) while using “Transfer to project” functionality

D365FO – AX – X++ – CopyAttachments (Copy attachments)

private void al0CopyAttachmentsQuotationToProject(RecId _SalesQuotationRecId, RecId _ProjTableId)     {         DocuRef salesQuotationDocuRef;         DocuRef ProjTableDocuRef;         //Search if exists an attachment for SalesQuotationTable         while select  salesQuotationDocuRef                     where salesQuotationDocuRef.RefTableId == tableNum(SalesQuotationTable)             &&   salesQuotationDocuRef.RefRecId == _SalesQuotationRecId         {             //Copy attachment into Project             DocuRef::createFromDocuRef(salesQuotationDocuRef,_ProjTableId , tableNum(ProjTable));         }         ;