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
melfmelf 

Add custom opportunity field to quote PDF.

Hello,

I am using Forcec.om labs Quote with line items Version:
0.95 / 8.1.  I am trying to add a few custom fields to the PDF output that will show up for all quote PDF
files.  I have added one of my fields “Invoicing_and_Payment_Terms__c”

to the Apex Class below in red:

 

// load up quote lines, opportunity lines, opportunity details and contact info
void init() {
queryQuoteLines(quoteid);

if ( quote.opportunity__c != null ) {
/* Set the related opportunity with the result of the query that traverses to account for display of the name
and down to get the primary contact role. */
opp = [select name, Invoicing_and_Payment_Terms__c,account.name,
(select contact.name, contact.mailingStreet, contact.mailingcity, contact.mailingstate,
contact.mailingpostalcode , contact.phone
from opportunityContactRoles
where isPrimary = true)
from opportunity
where id = :quote.opportunity__c];
if ( hasContact ) {
contact = opp.opportunityContactRoles[0].contact;
}
}
}

And added the below to the quotePDF page

 

 

“<apex:outputTextvalue="{!SFDC_520_Quote__c.opportunity__r.Invoicing_and_Payment_Terms__c}"/>“

 

 When I generate the PDF, the field does not show up. Am I missing something?

 

Thanks

 

Ron HessRon Hess
now that the new quote feature is built into the app, can you use that?
melfmelf
No, I need to be able to modify the PDF to show fields that we need such as these custom fields.
kamlesh_chauhankamlesh_chauhan

This may be the issue with rights of custom field. Can you please verify the User profile rights from which you are generating Quote PDF.

 

Regards,

Kamlesh

melfmelf

Kamlesh,

Thanks for the suggestion.  I verified that the field level security for my custom field grants access to the profile in use(System Admin) and verified the the enabled profiles in the security settings on the quotepdf page.  I have it wide open at the moment so all profiles can access the quote pages as I'm still in sandbox.

Could there be issues with the field type, it's a text 255?

Thanks again for your help.