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
Firoz KamdarFiroz Kamdar 

VF Page Implementation Troubles

Hello!  I'm brand new to the VF/dev side of SF.  I've written a VF using the standardController for an SF managed package (FSC).  I want to insert this page into a Case page layout.  While researching, many people said that your standardController has to be for the object you want the add the VF page to, which in this instance, it would be the Case object.

Question:  How do I go about referecing the Financial Accounts object in the FSC package if I use a standard controller.  Or is this something that will require a custom controller?

Code Sample:

<apex:page standardcontroller="FinServ__FinancialAccount__c">
<apex:pageBlock title="Trust Info">
<apex:pageBlockSection columns="2">
<apex:outputPanel layout="block">
<b>Trustee State of Residence:</b>     {!FinServ__FinancialAccount__c.Individual_Trustee_State_of_Residence__c}<br/><br/>
<b>Trust Capital Gains Taxable To:</b>    {!FinServ__FinancialAccount__c.Trust_Capital_Gains_Taxable_To__c}<br/><br/>
</apex:pageBlockSection>
</apex:page>
Raj VakatiRaj Vakati
You are correct ... standardController would be the for the Sobject.

How do I go about referencing the Financial Accounts object in the FSC package if I use a standard controller   Or is this something that will require a custom controller?


You need to use the extension controller in that case as shown below 


Change your code as shown below
 
<apex:page standardcontroller="Case" extensions="FinancialAccountExtension">
<apex:pageBlock title="Trust Info">
<apex:pageBlockSection columns="2">
<apex:outputPanel layout="block">
<b>Trustee State of Residence:</b>     {!finServ.Individual_Trustee_State_of_Residence__c}<br/><br/>
<b>Trust Capital Gains Taxable To:</b>    {!finServ.Trust_Capital_Gains_Taxable_To__c}<br/><br/>
</apex:pageBlockSection>
</apex:page>
 
public class FinancialAccountExtension {

    private final Case cases;
    public FinServ__FinancialAccount__c finServ {get;set;} 
   
    public FinancialAccountExtension(ApexPages.StandardController stdController) {
        this.cases = (Case)stdController.getRecord();
		
		finServ = [Select Id ,Individual_Trustee_State_of_Residence__c , Trust_Capital_Gains_Taxable_To__c from FinServ__FinancialAccount__c where Case__c =:cases.Id ] ; 
    }

   
   
   
}



https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_extension.htm

 
Firoz KamdarFiroz Kamdar
Thanks! I've tried this, but am receiving class errors.  "No such column 'Case' on entity 'FinServ__FinancialAccount__c'."

I'll research on the link you sent and keep at it.
Firoz KamdarFiroz Kamdar

this is another error:  Unknown property 'CaseStandardController.FinServ'

<apex:page standardcontroller="Case" extensions="FinancialAccountExtensions">

    <apex:pageBlock title="Trust Info">
            <apex:pageBlockSection columns="2">
            <apex:outputPanel layout="block">
                <b>Trustee State of Residence:</b>     {!FinServ.Individual_Trustee_State_of_Residence__c}<br/><br/>
                <b>Trust Capital Gains Taxable To:</b>    {!FinServ.Trust_Capital_Gains_Taxable_To__c}<br/><br/>
            </apex:outputPanel>
            </apex:pageBlockSection>
     </apex:pageBlock>
</apex:page>