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)
{
DocuRef salesQuotationDocuRef;
//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));
};
}
Inside class create a Chain of Command of “linkQuotationToProjectMethod” and call “al0CopyAttachmentsQuotationToProject” method. This will copy attachments to project
public void linkQuotationToProject(ProjId _projId, ProjInvoiceProjId _projInvoiceProjId)
{
ProjTable projTableLocal = ProjTable::find(_projId);
next linkQuotationToProject(_projId, _projInvoiceProjId);
//Copy salesQuotationTable attachments to existsing ProjTable
this.al0CopyAttachmentsQuotationToProject(salesQuotationTable.RecId,projTable.RecId);