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
Rick_NookIndRick_NookInd 

Workaround to relate "Content" objects

My boss and I are trying to brainstorm up how we could "in effect" relate "Content" objects in a many to many relationship.  I have to do this or I'll have to end up developing document management from scratch instead of using "Content".

 

You can't actually do it because you can't have a Lookup to a Content object (or a Document) in a junction object or apparently in any object.  You can't do it "in effect" in one multi-select picklist (populated via Metadata API) because there is a limit to 150 pick list entries per multi-select picklist.

 

Here's what we are thinking and I'd like to get your input or other suggestions:

 

We create a custom formula with HYPERLINK that somehow gets to a visualforce edit page passing in the Id (since you can't alter the layout as far as I can tell).

 

On that visualforce page we have a number of multi-select picklists which we dynamically populate with 150 document control numbers each with a custom controller (is this possible?).  Then in the custom controller we concatenate the document control numbers and save them as a comma separated string.  The controller would also have to parse the string to initially populate which items are selected in the multi-select picklists.

 

Any comments on the overall idea? Do you think this would work?

bob_buzzardbob_buzzard

Could you not use something that is effectively a junction object, but rather than having lookup/master detail fields, simply have two text fields containing the ids of the content items you wish to relate.  You'll end up having to write more Apex code to convert to/from ids, traverse relationships etc, but I've found with content that's pretty much always the case.