2

I want to create a master-detail or lookup relatioship between my custom object and the Event standard object. My custom object would be the child. The problem is that the Event object is not available in the picklist when trying to create the master-detail or lookup relationship.

Is this a limitation of the platform? Is there a way to activate this feature via support requests?

Thanks.

3 Answers 3

2

It sounds like the only way to do this is to create a custom events object. As ajay mentioned it is not possible with the standard activity object. Another suggested workaround from this q/a here

Activities (Tasks and Events) cannot be the type of a lookup field for any object.

Out of the box an activity can only link to a single 'What' object, and can be linked to a maximum of 50 'Who' (Contact) objects if it's non-recurring and the feature has been enabled.

You would need to create a custom Visualforce page extending the relevant standard controller and build your related list completely using custom code to achieve what I think you want.

1
  • 1
    While the idea is great and would like to see it in action asap, the OP wants the other way round - create lookup/master field for Event(master/parent record) on custom object record(child) which is not feasible as of now. Jul 2, 2015 at 15:58
2

you can not create lookup or master detail relationships on event object (parent).

1
  • 1
    I think you can now (Summer '15) create lookups on Event. Jul 2, 2015 at 16:24
1

The problem you are presenting is something similar to what I just recently encountered in one of my projects. Like mentioned by others

You can't create a master-detail or lookup relationship to Activities (Tasks/Events) object.

Workaround

Solution I implemented was, I created a text (length 18) field that I populated using the apex with the EventId. Two points to note in this solutions:

  1. This solution works via apex/trigger; not from the UI. So, if you are looking to present this to your end-users, it won't make much use. My use case was to update the object when some other process runs, so it perfectly fulfilled my need; and I'm not showing it to the end-user, even though it is useful in related processes. But the end-users need not to know everything.
  2. If you want to show the end-users what event is attached to your custom object, you could create another text field with read-only access and fill it with the event name.

P.S. Above solution may or may not work as is in your situation, so you might need to tweak it as per your needs; and also, you need to understand that any changes in Event name, etc won't have an impact on your custom object link as they are not in a true relationship.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .