You need to sign in to do that
Don't have an account?
_why the unlucky stiff
Formatting PDF
Hello I have a page that I am trying to generate as a PDF. I am trying to access values from a custom object 'FieldVisitors__c' to display on the PDF page. So far, I have had no luck. Could some gentleman explain how to access fields from this custom object to display on the PDF page?
As you can see below, I was only able to get the User name and date to work. I need to access fields like FieldVisitors__c.Subject
Account Name (A lookup field to Account object) etc...
Can someone point me to the right direction? I am much obliged.
<apex:page standardController="FieldVisitors__c" renderAs="PDF" > <h1>Field Visit Report</h1> <h2>Report Created By {!$User.FirstName} on {!NOW()}</h2> </apex:page>
Since its a standard controller so provide id of FieldVisitors__c to the url.
And for the field name, check the way you access the fieldname in soql query.
If The field name in FieldVisitors__c is Subject_Account__c.Name,
then use FieldVisitors__r.Subject_Account__c.Name
Check below code to access Name field.