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

Related To in Custom Objects


I am creating a custom app which has four custom object and the first 
three are master object for the fourth one. 

In the fourth object (i.e. the child of all the other object) I would 
like to create a "Related To" field, this field would have one drop 
down to select which object type (one of the three custom objects)  I 
want to relate it to and the second field a lookup for the record to 
which it would be related. 

This feature is already there in events and tasks object. I want to 
replicate the feature in custom object. 

I know this would be a customization, however, I am trying to debate 
on best probable ways to do this. 

Please help. 



It's not even customization, it's outright Visualforce coding. You see, that multi-type dropdown for tasks/events is a specially hard-coded feature that can't be replicated using only customization. At minimum, you need one field for each type of lookup, then a Visualforce piece to allow the user to switch between them. A bit too much like work, if you ask me. I'd say you just have the multiple fields on your layout, and restrict them to a only-one-choice option by validation rules.