Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Opportunity openOpp = [
- SELECT Id
- FROM Opportunity
- WHERE IsClosed = false
- LIMIT 1
- ][0];
- Quote newQuote = new Quote(
- OpportunityId = openOpp.Id,
- Name = 'doesn't matter'
- );
- insert newQuote;
- // You can't query this object so you have to hard code a quote template ID
- // We use a custom setting
- Id templateId = '';
- String url = '/quote/quoteTemplateDataViewer.apexp?id=' +
- newQuote.Id + '&summlid=' + templateId;
- PageReference contentSource = new PageReference(url);
- Blob pdf = contentSource.getContentAsPDF();
Add Comment
Please, Sign In to add comment