function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
QuoteDocument attachment = new QuoteDocument(); attachment.QuoteId = recordId; PageReference pdf = Page.YOURPAGENAME; pdf.getParameters().put('Id', recordId); pdf.getParameters().put('displayOnly', '1'); pdf.setRedirect(true); try { attachment.document = !Test.isRunningTest() ? pdf.getContent() : Blob.ValueOf('dummy text'); } catch (Exception e) { attachment.document = Blob.valueof('There was an error.'); String msg='Unexpected Error. Error Message - '+e.getMessage(); } insert attachment;
sample code is here
All Answers
sample code is here