function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rajkumar VenkatRajkumar Venkat 

How to copy the attachment to quotedocument? attachment is created by any appexchange products

Best Answer chosen by Rajkumar Venkat
Rajkumar VenkatRajkumar Venkat
Drawloop is not supporting to create quote document directly. The workround is,

list<quoteDocument> lstQuoteDoc= new list<quoteDocument>();
      
    List<Attachment>  attlist =[select id,Body,Parent.Type,parentid from Attachment where id=:trigger.newMap.KeySet() and Parent.Type= 'Quote'];
       
    for(Attachment att: attlist)
    {       
        quoteDocument quoteDoc= new QuoteDocument();
        quoteDoc.QuoteId=att.parentid;
        quoteDoc.Document = att.Body;
        lstQuoteDoc.add(quoteDoc);        
        
    } 
    insert lstQuoteDoc;
    delete attlist ; 
 please follow the below code.. anyother better approach, pls share it..