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
JeriMorrisJeriMorris 

Create Custom Object with fields for a Contact / Opportunity

I'd like to create a Custom Object that has fields describing a question asked by a given Contact for a given Opportunity.  I suspect I want my Custom Object to have a Relationship with the ContactRole object, but ContactRole (or AccountContactRole or OpportunityContactRole) doesn't appear in the Related To pulldown on the New Relationship page. How do I set up that relationship?

(Sorry if this is a newbie question. I've been through the Customforce for Smarties document, but haven't had any other training. Is there anything else I should read?)

Thank you,

Jeri

 

Ron HessRon Hess

You may be forced to relate the Contact table to the Opportunity table directly with a new "relation" object, which is related to each of these primary objects and can then hold the questions ( you could even add "role" to this relation... _)

i don't see how you can relate ContactRole and Opportunity if ContactRole is not in the "relate to" pull down list when creating a custom object.

JeriMorrisJeriMorris

> i don't see how you can relate ContactRole and
> Opportunity if ContactRole is not in the "relate to"
> pull down list when creating a custom object.

Should ContactRole be in the "relate to" pull down list? I'm surprised that it's not. Is there a way to get it there?

If the Contact/Opportunity relationship is already defined as a standard (non-Custom) object, it feels like I shouldn't have to create a new one. Is there a way to make the existing Contact/Opportunity relationship accessible to my custom object?

Thanks!

Jeri

spazurespazure

JeriMorris wrote:

> i don't see how you can relate ContactRole and
> Opportunity if ContactRole is not in the "relate to"
> pull down list when creating a custom object.

Should ContactRole be in the "relate to" pull down list? I'm surprised that it's not. Is there a way to get it there?

If the Contact/Opportunity relationship is already defined as a standard (non-Custom) object, it feels like I shouldn't have to create a new one. Is there a way to make the existing Contact/Opportunity relationship accessible to my custom object?

Thanks!

Jeri





Should it be available? IMHO, yes, but it's not. Although I've never seen the actual Salesforce.com backend, I know it's running an Oracle SQL db -- which means I can at least make some educated guesses as to where the development issues are hiding. I'm sure someone will correct me if I'm wrong, but here's the reasoning, as I see it:

Firstly, there is no ContactRole object. A glance at the ERD will show that for each type of record that has contact roles, there is a separate object for those contact roles. Specifically, these objects are ContractContactRole, AccountContactRole, and OpportunityContactRole. These appear to be 'special' objects, as the relationships to their parent objects is hard-coded in the system, and cannot be modified.

The downsides:

1) Due to this database design, you cannot add a "Contact Role" related list to a contact. That's because related lists are pulling data from a particular object, and to provide such a list would require pulling relevant data from ContractContactRole, OpportunityContactRole, and AccountContactRole. Although I know the backend database could do this, I'm thinking the limitation may be based on how the base code for related list integrations is setup. (Alright, so that's not exactly what you asked -- but it's been bugging me, and is backup material for my final point)

2) No contact roles on custom objects. That would be nice, but it would essentially require creating brand new object (since the ObjectContactRole objects have hard-coded relationships).

In short, I agree. You shouldn't have to create a new custom object to get this done, but the current design doesn't appear to give us another option. I'm willing to bet that ContactRoles were put in initially as an "I have an idea!" sort of thing that didn't have much planning -- at least that's how it appears. As far as I can tell, to get Contact Roles to behave like you and I want them to (and yes, the resolution is the same), an overhaul of the backend would be required. It may only take a short time to write it out on paper, but designing something from scratch is always easier than working with such an extensive database of information.. and they won't let me to do it for them.

I suggest a detailed, well-phrased feature request. One request may not mean much, but if people like you and me keep writing in, it'll eventually become a priority.