Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, February 22, 2025 
 
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!
 Web Forums - SalesLogix Web Platform & Application Architect
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: How to design this relationship in AppArchitect?
Alec Denholm
Posts: 23
 
How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Feb 08 5:58 AM
I'm trying to re-create a LAN tab in 7.2 web. The contact-level tab shows other contacts at the account of this contact; a sort of 'sibling' relationship if you consider the contact to be a child of an account.

So I'm trying to make AppArchitect understand I want a grid which shows contact data where the accountID of those contacts = the accountID of the current contact. How do I design this relationship? Or is there a much simpler way of achieving this?

Thanks in advance for any help you can offer.

- Alec D, QGate
[Reply][Quote]
Mark Dykun
Posts: 297
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Feb 08 6:31 AM
Alec, the Relationship should already exist since the contacts are children of the Account.

Your contact instance has a reference to an Account entity. That Account entity would already have a property on it called Contacts (ICollection). This would be a List of contacts owned by the account. you could add a custom property the the contact to return the relationship with the current contact filtered out.

namespace Sage.BusinessRules.CodeSnippets
{
public static partial class ContactBusinessRules
{
public static void GetContactSiblingsStep1( IContact contact, out ICollection<IContact> result)
{
EntitySet<IContact> contacts = new EntitySet<IContact>();
foreach (IContact currCont in contact.Account.Contacts)
{
if (contact.Id != currCont.Id)
contacts.Add(currContact);
}

return contacts;
}
}
}


Code is untested but I hope it leads you in the right direction.

Regards,
Mark




Mark
[Reply][Quote]
Gene
Posts: 3
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Feb 08 1:57 PM
Ok Mark I have looked all over for EntitySet and can't seem to find the namespace it is part of.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Feb 08 4:54 PM
Quote:
Originally posted by Gene

Ok Mark I have looked all over for EntitySet and can't seem to find the namespace it is part of.


I use an IList for this.
[Reply][Quote]
Mark Dykun
Posts: 297
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Mar 08 10:15 AM
EntitySet is a 7.2.2 thing Gene. Sorry for not clarifying.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Mar 08 10:41 AM
Quote:
Originally posted by Mark Dykun

EntitySet is a 7.2.2 thing Gene. Sorry for not clarifying.


Hi Mark,

Have you looked into what benefits there are in using EntitySet vs a standard IList? I've noticed that many OOTB business rules still return an IList. EntitySet inherits from AbstractEntityCollection (which implements ICollection & IEnumerable). It does appear to have some extra stuff in it, but couldn't see any clear cut reason to use it instead of an IList.

Have you seen anything that would show benefits using one vs. the other?

-Ryan
[Reply][Quote]
Mark Dykun
Posts: 297
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Mar 08 10:48 AM
Honestly I have not dug that deep into it. I noticed when looking at how the new business rule was supplied for getting the Account contacts was using this approach, I was assuming this was going to be the new standard moving forward. I understand that you are returning an IList but specifically what concrete type. Since IList is an interface there needs to be a creatable class type to add these entities to. Are your returning a List<Entity> .

Mark
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Mar 08 11:02 AM
Quote:
Originally posted by Mark Dykun

Are your returning a List<Entity>


Sorry, should have clarified. Yes, I am returning a List<Entity>.

-Ryan
[Reply][Quote]
Alec Denholm
Posts: 23
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Mar 08 9:37 AM
Thanks for the help so far guys.

I've got an error trying to compile that code:
ERROR - C:\Documents and Settings\vmuser\Application Data\Sage\Platform\Output\Sage.SnippetLibrary.CSharp\src\Sage.SnippetLibrary.CSharp.@.52ad8989-2aa4-40da-8bba-6e8da054b031.codesnippet.cs(31,75):
The type or namespace name 'ICollection' could not be found (are you missing a using directive or an assembly reference?)

Which using directive/assembly reference am I likely to be missing? Thanks again.
[Reply][Quote]
Mark Dykun
Posts: 297
 
Re: How to design this relationship in AppArchitect?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Mar 08 6:44 AM
If you can please post your code for the business rule so that I can determine what is happening. Gennerally it looks as if thw System.Collections - or - System.Collections.Generic namespace is not mapped into the class however you may be using the wrong type of collection for what you are trying to do so seeing the code will help with this determination.
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/22/2025 8:59:21 AM