You need to sign in to do that
Don't have an account?
Connor Scott
custom related list on visualforce pdf page.
Hello all,
Im currently trying to build a pdf page for accounts, and that page has a section that pulls a list of all open opportunities for that account. Below are relevant samples of my code.
Regards,
Connor
Im currently trying to build a pdf page for accounts, and that page has a section that pulls a list of all open opportunities for that account. Below are relevant samples of my code.
<apex:page standardController="Account" extensions="ActProp" renderAs="pdf"> <apex:pageBlock title="Proposals"> <apex:pageBlockTable value="{!Account.Opportunities}" var="o"> <apex:column value="{!o.Name}"/> <apex:column value="{!o.StageName}"/> <apex:column value="{!o.Amount}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
public class ActProp{ public ActProp(ApexPages.StandardController cont) {} List<Opportunity> props = [Select Name, StageName, Amount, AccountId from Opportunity where StageName = 'Proposal Creation' or StageName = 'Proposal Revision' or StageName = 'Proposal Review' or StageName = 'Negotiation']; public List<Opportunity> getprops(){ return props; } }Ive only been able to work with apex for less than a week, so my code may be just natually clunky. Whenever I send the visualforce page and apex class into production, They just barely dont meet the 75% test rate, and most of the errors mention a missing required field Company__c. My question at this point is where would this field go? ive tried putting it in the query, in the vf page, and I just can't figure out where to slot it in. Any insight is greatly appreciated, as i'm guessing my code has more than a single problem.
Regards,
Connor
- I read your problem and implemented it in my Org and it is working fine.
- Please use the below code and customize as per your need: -
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.