Login / Register  search  syndication  about

          Ryan Farley's Blog

Ryan Farley on .NET Development with a focus on CRM Development for SalesLogix

Writing Queries for the SalesLogix SData API

In this fourth post in the SalesLogix SData series, I will introduce how to write queries for SalesLogix SData and will point to a useful resource as you get started, or more comfortable with SData.

View the SalesLogix SData series index

SData Query Language

Be sure to first take a look at my last post which covers how to retrieve data via the SData API. The ability to read data from SalesLogix via the SData API is only useful if you know how to control it. Reading all records from a table isn't exactly useful. Knowing how to control which records you're retrieving is a must. Fortunately, that is easy, but it does take some knowledge of the SData Query Language.

SData uses a language refered to as SData Query Lanaguage. So, what does this mean to you, another thing to learn? Not really. The syntax for the language is simple and easily guessable. If you know how to write NHibernate queries then this won't look much different. As a matter of fact, if you know how to write SQL queries, this won't really look much different.

Example Query Conditions

Before we get too deep into things, let's take a look at some sample query conditions using SData. As I showed in the previous post (Retrieving Data via SData), you can use these conditions by adding them to the QueryValues collection of the SDataResourceCollectionRequest for the "where" part of the query.

  1. Retrieve all records created since 5/1/2011
    "CreateDate ge @2011-01-05@"
  2. Retrieve all account records whose Name starts with the letter A through L
    "left(AccountName,1) between 'A' and 'L'"
  3. Retrieve all SalesOrders whose State on it's associated BillingAddress is 'AZ'
    "BillingAddress.State eq 'AZ'"
  4. Retrieve all Accounts whose name contains the word Bank
    "AccountName like '%bank%'"

You'll see something that looks familiar and understandable with all of those.

Query Conditions, Functions, & Operators

So what are all the possible things you can use in an SData query? Rather than list them all here, I will point to the official SData specification where it outlines the available functions and operators for SData.

SData Query Language  on SData Core Specification

View the SalesLogix SData series index

What's This?
Bookmark and Share

About Ryan Farley

   Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

View the SalesLogix Mobile Seveloper Series
View the SalesLogix SData Developer Series
View the Git for the SalesLogix Developer series

Related Content
   Can I Bind an Attachment to a Specific Activity in Infor CRM version 7.54?
Recently I had a user ask if they could bind an attachment to a specific Activity within Infor CRM??
Posted on Jul 07, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (formerly SalesLogix) Administrator Locked Out
I thought I had seen all the issues affecting the datalink but this was a new one. We could not login t
Posted on Jun 18, 2015 by Mark Duthoy to SalesLogix Support
   How do I remove users from my Infor CRM system (formerly SalesLogix)?
I had an Administrator ask me for the steps they needed to take in order to remove a user from the Infor
Posted on May 08, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (Formerly Saleslogix) v8.1 update 03 and 05- Uncaught Error Scheduling Contact Processes
 In the Infor CRM (formerly Saleslogix) web client, under the Contact area you have the ability to s
Posted on May 07, 2015 by Kris Halsrud to Kris Halsrud's Blog
   Better Code Organization for Infor CRM (Saleslogix) Mobile Customizations
When customizing the Infor CRM (Saleslogix) Mobile client, it's common for the ApplicationModule to g
Posted on May 05, 2015 by Ryan Farley to Ryan Farley's Blog


Marcel Heuberger said:

Hi all,

Does anybody know how to filter a "child" entity by calling an URL?

Something like:

localhost/.../funds(ID eq '39506')?include=histories(category eq 'Monitoring Report Comment')

Is it even possible to limit the child entity? I don't like the fact, that I provide all history records for each call. I guess I can imagine how many history entries an entity can have in SLX. I would like to only get the ones with the specific category 'Monitoring Report Comment'.

Any hints or tips much appreciated :)



December 21, 2011 8:24 AM

Leave a Comment

All contents Copyright © 2015 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register