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));



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s