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
Mohammed AzarudeenMohammed Azarudeen 

Setting Up 1 : N, N:1 Relationship in VFP

My scenario : I am having custom object called Module__c, where users can able to type module names/name in a multiline textbox and that module should be assigned to users/user(standard user object users).

for example :                  Module Name                                                                User
                                     Account Management                                                 
                                     Asset Management

for the above example both Account and Asset management Modules this username is assigned( Many To One i.e, N : 1). Likewise for single Module Many users can assign. How can I achieve this functionalities. Any link, suggestions, idea, code snippet is helpful.

Adrian  GawryszewskiAdrian Gawryszewski
So first of all you want be able to do it using standard relationships as the user cannot be a child in any type of them (so can't be N). In my opinion if you really want to display users assigned to that particular record you would have to create a vf page with a cutom/extension controller which would query for all the records of that object grouped by user and then get the data from there. Or get a set of all the userId from that query and then another query to get those users.. In any way it is not a pretty solution. 

The other thing you could do is have a custom object to work as User. This way you could use many-to-many or even double lookup on both sides (module and custom user object).