You need to sign in to do that
Don't have an account?
Display Related List Based on Account "Type" field
I'm new to Visualforce and APEX;
Here is some background on what I am trying to do - Each Account is assigned either "Agency" or "Client" picklist values under the "Type" field. (I am using Professional edition, so I am not able to create different Account Record Types). My company's Opportunities always relate to TWO Accounts - one of each type. I currently have the Opportunity Account Name field looking up Agency Accounts and a custom look up field to assign the Client Account.
The issue I have is displaying redundant Related Lists on the Account Page - for "Agency" accounts, this is fine.. the Opportunities show up under "Opportunities" related list. For Client Accounts, however, the related Opportunities display on a separate related list created by the custom look up field.
Any direction on the best way to tackle this is appreciated - below I've listed my ideas, but I don't know how to execute any of them (I'm shuffling around in the Visualforce inline page documentation but quite confused...) Also - please let me know if what I am trying to do requires Enterprise.
-HIDE empty related list
-DISPLAY related list based on Account Type Field value (using an inline visualforce page?)
-restructure how i point opportunities to multiple accounts..
I managed to solve this creating custom VF pages and just using an IF formula in the render field for which related list to display - no enterprise necessary.
All Answers
We encountered something similar a while ago with up to 4 accounts associated with a single opportunity, leading to four related lists. We created a visualforce page that retrieved all of the opportunities that an account was associated with and displayed them in a single list view clone.
I don't think you'll be able to do this using standard controllers though, so Enterprise would be required for the apex classes.
I managed to solve this creating custom VF pages and just using an IF formula in the render field for which related list to display - no enterprise necessary.
I'd love to learn more about how you solved this. Could you post a code sample?
Sure -
I'm also new to VF and APEX
How i can hide an Section in an Page layout if an Fields is Bank ?
regards john
I am new to Apex and VF. I have a similar requirement to hide Related lists based on Parent field value. Where exactly i have to put the below code and how to reference this VF page on UI? apprecite your help on this.
<apex:relatedList list="Opportunities" rendered="{!IF(CONTAINS(Account.Type,'Client'), false, true)}"/>
Thanks,
reddy.