Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, July 1, 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: Filtering Types of Contacts under an Account
MCordero
Posts: 12
 
Filtering Types of Contacts under an AccountYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Feb 10 9:05 AM
Under the Contact tab of an Account, I'm trying to create filters to show only certan types of contacts.

I was able to create a tab that Listed only contacts with type Patient:
criteria.Add(ef.Eq("Account.Id", account.Id.ToString()));
criteria.Add(ef.Eq("Type","Patient"));

On my other tab, when trying to filter OUT patients to show everyone else, If the contact type is NULL it won't show at all
criteria.Add(ef.Eq("Account.Id", account.Id.ToString()));
criteria.Add(ef.Ne("Type","Patient"));

I tried adding: criteria.Add(ef.Disjunction().Add(ef.IsNull("Type")));
but i'm sure its wrong because it then gives me an empty list.

what's the correct way to add the "or" statement?

[Reply][Quote]
Jason Daraz
Posts: 12
 
Re: Filtering Types of Contacts under an AccountYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 10 4:44 AM
Hope this helps, dug this out of an FAQ I had lying around:

By default, calling ICriteria.Add(IExpression) successively will combine all expressions with the AND junction.
If you want to combine an arbitrary number of expressions with OR, you can use the IJunction interface, as follows:

Sage.Platform.Repository.IJunction junction;

if (weWantToAndThisExpression)
{
junction = ef.Conjunction(); // AND
}
else
{
junction = ef.Disjunction(); // OR
}

ICriteria.Add(junction
.Add(ef.Eq("Account", account))
.Add(ef.Eq("IsPrimary", true)))
.List();


Looks like you might wanna try something like:

criteria.Add(ef.Eq("Account.Id", account.Id.ToString()));
criteria.Add(ef.Disjunction().Add(ef.IsNull("Type")).Add(ef.Ne("Type","Patient")));
[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): 7/1/2025 2:58:53 AM