1

We are facing a limitation with the Activity object and hope that some of you have workarounds to offer.

Use Case: We want the ability to link up to 5 records from a custom object from the Acitvity object. So if I am on an activity record I see 5 custom fields

Field 1 to custom object record
Field 2 to custom object record
etc.. til field # 5

Sounds easy on the paper: Just add 5 look-up fields to the custom object.

Problem: Activity cannot have multiple relationships to the same object... So we can have only 1 lookup field per object (see validation error message from SFDC below)

Has anyone a workaround or idea?

Could a custom VF page overcome this issue?

Thanks!

Error message:

Validation Errors While Saving Record(s) There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Lookups on activites must have a unique domain. You can not have multiple relationships to the same object.".

1

Activities are a real pain for this kind of thing. Generally the only way to go about it is to instead use text fields to store associated record Ids, and then use joins or multiple queries to get to the data you desire.

This is great from a code point of view, but it doesn't help with things like displaying a related list. If you need that kind of functionality you're going to need to build a Visualforce component or page (or Lightning component!), and of course things such as cross-object formula fields are out. Wish I had better news for you!

  • I wish you add better news too, but at least I know where I stand now! Thanks a lot! – Xavier T. Dec 16 '17 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.