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
uHaveOptionsuHaveOptions 

Getting Related List Field Values and Storing Them as PickList in Object

So I have Contacts and have Ownership Related List with columns like Prop Type.  I would like to get the list in the realted list and store them as a picklist in Contact in Prop_Type__c (picklist).  

Scenario:
Contact John Doe
Has Ownership Related List with Prop Type 1, 2, 3 & 7

Ideal scenario:
Contact John doe detail page shows 1,2,3 & 7 in Prop_Type__c (picklist)

So when I do a view list I can sort them out easily.

What will be the easiest solution for this?  I'm assuming it has to be a trigger?

thanks in advance
 
Ravi Dutt SharmaRavi Dutt Sharma
Hey Jon,

You can create a Trigger on Ownership object that will update the picklist present on Contact. I am assuming the picklist Prop_Type__c is a multi-select picklist and you want to select more values in it whenever a related Ownership record is created. In your trigger, you need to handle insert, update, delete and undelete events. Let me know if you have any questions. Thanks.