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
Prajapati.LakhanPrajapati.Lakhan 

Polymorphic lookup in custom object

Hi,

 


I have a requirement where a junction object can be used to associate set of objects to a particular object.

 

e.g. I want to create mapping between  A, B, C, D and X object. Either of A, B, C, D can be associated with object X. Instead of creating lookups for each object (A, B, C, D) I want to create only one text field which will store the SFDC ID (of A, B, C or D).

 

I want to know how feasible this data model is? What kind of problems i would face with this data model?

 

 

Thanks,

Lakhan

Dev MinorDev Minor
What you really need is a Custom Polymorphic Id field (WhoId/WhatId) (https://success.salesforce.com/ideaView?id=08730000000BqzBAAS)