AX / D365FO – Create a simple Note on a Table in X++

This example shows how to create a simple note on a Table (ie. SaleTable) The code will insert a new note in the salesTable Form (like shown below) Example code class CreateNote { public static void main(Args _args) { DocuRef docuRef; DocuActionArchive docuArchive; changeCompany('your company') { SalesTable salesTable = SalesTable::find("your order No."); ttsbegin; // Code … Continue reading AX / D365FO – Create a simple Note on a Table in X++

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) { … Continue reading 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));         }         ;