+ Start a Discussion
Akis AthanasiadisAkis Athanasiadis 

View related lists depending on picklist

I have a custom object named "Internal Assets" which has several related lists.
There is a pick list field in Internal Assets which conditionally creates a related list.
The picklist values are the following:
User-added image
When the desktop option is selected, a record is created in the related list.
However, I don't want to see all the related lists below:
User-added image
I would like to see only the related list which is related to the picklist item that is selected.
I believe that might happen using visualforce page. However, I am not sure how to set the conditional code (if exists) for that.
Any ideas?
Best Answer chosen by Akis Athanasiadis
MUHAMMED SEMIN P NMUHAMMED SEMIN P N
Hello,
Use <apex:relatedList> on VF Page.
Here is Sample code:
<apex:relatedList list="child relationship_name" rendered="{!IF(CONTAINS(Internal_Assets__c.picklist_api_name,'Picklist_Value'), false, true)}"/>
Hope this helps you!
If my answer helps resolve your question , please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
 

All Answers

MUHAMMED SEMIN P NMUHAMMED SEMIN P N
Hello,
Use <apex:relatedList> on VF Page.
Here is Sample code:
<apex:relatedList list="child relationship_name" rendered="{!IF(CONTAINS(Internal_Assets__c.picklist_api_name,'Picklist_Value'), false, true)}"/>
Hope this helps you!
If my answer helps resolve your question , please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
 
This was selected as the best answer
Akis AthanasiadisAkis Athanasiadis
Hi,

i understand this is the framework of my solution. I don't have any clue of apex code so I will need to go through this by creating a class which will be used as a controller in the VF page. Correct?