7/1/2025 12:32:10 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
How to relate a CONTACT to multiple ACCOUNTS in a different way?
Posted: 15 Dec 09 11:28 AM
|
I am trying to create a brand new smart part which would create a brand new loose association between a CONTACT and many ACCOUNTS. Each of our contacts gets a special report for MANY accounts, not just the single account that the contact is already tied to. I need a new tab on the CONTACT screen, that contains a data grid, which will list accounts and allow add/remove of ACCOUNTS via a lookup.
I’ve created a new table called ReportLink. It extends the CONTACT entity, and also contains a ACCOUNTID field which I added via db manager. I’ve already create a new form (smart part tab), with a grid and datasource.
I’m specifically struggling when trying to set the properties correctly (on the ds and grid) so that the grid only shows Accounts associated to the Contact found in the new ReportLink table. Can you give me your thoughts on how’d you do this? |
|
|
|
Re: How to relate a CONTACT to multiple ACCOUNTS in a different way?
Posted: 15 Dec 09 12:06 PM
|
If you are trying to relate each Contact to Multipe Accounts, why does the ReportLink table extends the Contact Entity? That seems to suggest that you have defined it with a One to One relationship, and this is probably the reason why you can't figure out how to do the Grid.
First of all, the ReportLink will be your Many to Many link table between Contacts and Accounts. Define the Entity on its own, with 2 fields (after the 5 standard fields): CONTACTID and ACCOUNTID Create a One to Many Relationship between the Contact and EntityLink. If done properly, the Contact Entity will now have an EntityLinks collection (notice the plural).
When you the define the Grid, you would select that EntityLinks Collection as the source for your Grid, thus it will only show EntityLink records associated with the Contact. You will also have to do a similar One to Many relationship to the Account table (from EntityLink) which will allow you to build a grid on the Accounts that show all associated Contacts via this relationship.
And, since you would have added these 2 relationships, when you look at the definition of the EntityLink Entity, it will contain now a Contact and an Account reference (not just the IDs). Having this relationship will allow you to choose Properties from the Account and/or Contact objects when designing the layout of the tabs. |
|
|
|
Re: How to relate a CONTACT to multiple ACCOUNTS in a different way?
Posted: 16 Dec 09 11:24 AM
|
Ah! Thanks! This is going to help a TON! I have one question.
I have recreated the ReportLink entity, which has both an ACCOUNTID and CONTACTID. It is no longer extending the CONTACT entity. I've also created the relationships so that the ReportLink entity has a reference to both Contact and Account like you said. I really feel on the right track now, so THANK YOU.
I want to create a tab that is on the (linked to) the CONTACT screen. The smart part nees to hold the new grid listing only the accounts linked via ReportLink. Do I create the new form under the new ReportLink entity or the CONTACT entity? |
|
|
| |
|
Re: How to relate a CONTACT to multiple ACCOUNTS in a different way?
Posted: 16 Dec 09 11:16 PM
|
You create it under the Contact Entity, then use the "EntityLinks" property to retreive the associated links. Also, this grid would only show associations through the EntityLinks table, not through the regular Acc/Con linkage.
If you want to mix it, then you would have to add a GetBy method to return both sets of data for the Datagrid. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|