06-02-2010 02:24 PM
I looked at the sample codes, and I can't figure it out.
Is it possible to add one Custom Table and attach it to the Contacts as well as the Companies and the Opportunities or would I have to make 3 tables in my case?
This is the error I get:
This custom sub-entity is not a sub-entity of companies Parameter name: company
The parent is indeed Contacts.
The sample codes are confusing because they let me think that one Custom Table can be attached multiple ACT!entities:
ICompanyDetailView icodv = e.View as ICompanyDetailView;
if ( icodv != null && !loadedTabs.ContainsKey(ParentEntity.Companies) )
if ( (CustomSubEntityDefinition.PARENT_ENTITY & ParentEntity.Companies) == ParentEntity.Companies )
loadedTabs[ParentEntity.Companies] = null;
IOpportunityDetailView iodv = e.View as IOpportunityDetailView;
if (iodv != null && !loadedTabs.ContainsKey(ParentEntity.Opportunities))
if ((CustomSubEntityDefinition.PARENT_ENTITY & ParentEntity.Opportunities) == ParentEntity.Opportunities)
loadedTabs[ParentEntity.Opportunities] = null;
Thank you very much!
06-02-2010 03:55 PM
I believe the API only supports identification of one parent entity within a custom sub entity.
That doesn't prevent you from adding columns in your sub entity which are the foreign keys of those other entities. You'd have to manage those key pair values in your code, but that shouldn't keep you from using data from that sub entity in other entity views.
If your sub entity was "Cool_Stuff" and parent was Contact, and your columns were
cool_Stuff ID, ContactID, description, opportunityid, companyID
Then you could create a control for Opportunities or Company that filtered the sub entity results by the current record's ID.
Is this what you're trying to do?