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
Behzad Bahadori 18Behzad Bahadori 18 

Unit test for QuoteDocument

How do I write a unit test for 
QuoteDocument qd = new QuoteDocument();
        qd = [SELECT CreatedById, CreatedDate, IsDeleted, Discount, GrandTotal, LastModifiedById, LastModifiedDate, Name, Document, QuoteId, Id, SystemModstamp 
              FROM QuoteDocument 
              WHERE QuoteId =: urlId
        Limit 1];
     
         blst.add(EncodingUtil.base64Encode(qd.Document));
         System.debug('the size of the file' + qd.Document.size());


           
        
         String formatJSON = JSON.serializePretty(blst);

record = new Document( FolderId = UserInfo.getUserId() ,AuthorId=UserInfo.getUserId(), Name = Name +'_' + datetime.now() +'.pdf', Body = b  ,ContentType='application/pdf;charset=UTF-8');

        
        System.debug('Record' + record);
        insert record;

 
Mahesh DMahesh D
Hii,

Please check the below post and it will solve your issue:

https://developer.salesforce.com/forums/?id=906F000000093ZEIAY

Regards,
Mahesh
Behzad Bahadori 18Behzad Bahadori 18
no it doesnt work for that