Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, September 17, 2019 
 
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!
 External Development Forums - General External Development
Forum to discuss general external development topic (related or not to SalesLogix development). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to General External Development | New ThreadView:  Search:  
 Author  Thread: [sublogix] Operator.IsNull and Operator.IsNotNull ?
Andrei Kruglov
Posts: 11
 
[sublogix] Operator.IsNull and Operator.IsNotNull ?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jun 12 6:38 AM
fiogf49gjkf0d
How to query some table using sublogix to make 'is not null' or 'is null' conditions?

I need something like this:

IList contracts = repository.Select()
.Where("AccountId", Operator.Equals, SlxAccountId)
.And(Operator.IsNotNull("EndingDate"))
.Execute();

or this:

IList contracts = repository.Select()
.Where("AccountId", Operator.Equals, SlxAccountId)
.And("EndingDate", Operator.IsNotNull)
.Execute();

Unfortunately, there are no workaround - i've tried so:

IList contracts = repository.Select()
.Where("AccountId", Operator.Equals, SlxAccountId)
//.And("EndingDate", Operator.IsNot, DBNull.Value )
//.And("EndingDate", Operator.IsNot, null )
//.And("EndingDate", Operator.Equals, DBNull.Value )
//.And("EndingDate", Operator.Equals, null )
.Execute();
[Reply][Quote]
Andrei Kruglov
Posts: 11
 
Re: [sublogix] Operator.IsNull and Operator.IsNotNull ?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jun 12 6:44 AM
fiogf49gjkf0d
Of course, I can use client-side LINQ expressions, but it's not good desision:

IList contracts = repository.Select()
.Where("AccountId", Operator.Equals, SlxAccountId)
.Execute()
.Where(x => x.Endingdate == null && x.Startdate != null ).ToList();
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: [sublogix] Operator.IsNull and Operator.IsNotNull ?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Jul 12 10:39 PM
fiogf49gjkf0d

Andrei,


I have posted a new version of Sublogix (version 1.3.0.0) which fixes this bug. To query for null values you can do the following:


var repo = new Repository(ConnectionString);
var list = repo.Select()
.Where("Assistant", Operator.Is, DBNull.Value)
.Execute();

To get this new version use the NuGet package manager to get the updated assembly.


Ryan

[Reply][Quote]
Andrei Kruglov
Posts: 11
 
Re: [sublogix] Operator.IsNull and Operator.IsNotNull ?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Aug 12 8:40 AM
fiogf49gjkf0d
Quote:
I have posted a new version of Sublogix (version 1.3.0.0) which fixes this bug. To query for null values you can do the following

Oh, it's great! I've tried this version - work fine! Thanks!
[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 © 2019 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): 9/17/2019 4:36:20 PM