apex - Usage of independant blocks inside of a method

zenith – Creating quotes – code simply stops working with no errors Answer

Hello expensive customer to our community We will proffer you an answer to this query zenith – Creating quotes – code simply stops working with no errors ,and the respond will breathe typical by way of documented data sources, We welcome you and proffer you fresh questions and solutions, Many customer are questioning concerning the respond to this query.

zenith – Creating quotes – code simply stops working with no errors

I created the next to create Quote information and PDFs for all of them. The code runs up till QuotePDF.Document = QuoteWeb page.getContentAsPDF();after which simply stops, with no errors of any kindly. The quote information which had been already inserted don’t truly display up in SF. Never seen such an vacant failure with no message earlier than. Any concepts?

public class EmailPDFQuote implements Queueable, Database.AllowsCallouts {

    public List<Opportunity> Opps;
         
    public void assassinate(QueueableContext context) {
        system.debug('Opps="+Opps);
        Quote [] QuotesToInsert = fresh List<Quote>();
        
        for(Opportunity Opp: Opps){
            
            Quote Q = fresh Quote(Name = Opp.Name, OpportunityID = Opp.ID);
                QuotesToInsert.add(Q);
        }
        system.debug("QuotesToInsert="+QuotesToInsert);
        strive{
            insert QuotesToInsert;
            system.debug("QuotesToInsert="+QuotesToInsert[0].Id);
        }
        enmesh(DMLexception e){
            system.debug(e);
        }

        
        QuoteDocument [] PDFs = fresh List<QuoteDocument>();
            system.debug("QuotesToInsert="+QuotesToInsert);        
        for(Quote Q: QuotesToInsert){
            PageReference QuoteWeb page = fresh PageReference("/quote/quoteTemplateDataViewer.apexp?id='+Q.Id+'&summlid=0EH1Y000000zeer'); //quoteUrl +='&headerHeight=190&footerHeight=188&#toolbar=1&navpanes=0&zoom=90'; 
                system.debug('QuoteWeb page="+QuoteWeb page);
            QuoteDocument QuotePDF = fresh QuoteDocument(); 
                system.debug(QuotePDF);
                QuotePDF.Document = QuoteWeb page.getContentAsPDF();  //Blob b = pr.getContentAsPDF();  
                QuotePDF.QuoteId = Q.Id;  
            system.debug(QuotePDF);
            PDFs.add(QuotePDF);
                system.debug(QuotePDF);
        }
            system.debug("PDFs="+PDFs);
        strive{
            insert PDFs;
                system.debug("okay');
        }
        enmesh(DMLexception e){
            system.debug(e);
        }                 
    }
}

we’ll proffer you the answer to zenith – Creating quotes – code simply stops working with no errors query through our community which brings all of the solutions from a number of dependable sources.

Add comment