Sage SalesLogix
  • Contact Us
  • Sage North America
800-643-6400
Welcome Twitter Facebook LinkedIn
Community Home Blogs Share Ideas Search Request Access Resources
Reply
New Member
ahoekstra
Posts: 19
Registered: 08-23-2010
Accepted Solution

SData related entity "include" in Query

I’m using the SData Client Library and am trying to use the ‘Include’ parameter for a query. So, for example, I want to return the Address fields from Accounts. If I were reading a single record, I would do something like this:

 

SDataSingleResourceRequest sr = new SDataSingleResourceRequest(OrigSDataSvc);

sr.ResourceKind = “accounts”;

sr.ResourceSelector = ID;

sr.Include = “address”;

entry = sr.Read();

 

However, I’m trying to return the address as a group result of a query using the SDataResourceCollectionRequest Object.

 

This object does not have an “Include” parameter, even though it looks like it should be possible according to the specs here: http://interop.sage.com/daisy/sdata/Queries/ControllingThePayload.html

 

So, question is – can I use “Include” on a query or is it only possible with a Single request? If not possible, would I then have to iterate each result in a query result with an additional Single request?

 

Please use plain text.
Employee
markanderson
Posts: 13
Registered: 08-17-2009

Re: SData related entity "include" in Query

With the SDataResourceCollectionRequest class, the include is a query parameter. Here's an example:

var service = new SDataService("http://localhost/sdata/slx/system/-/", "admin", "");
var request = new SDataResourceCollectionRequest(service)
{
ResourceKind = "libraryDirectories",
QueryValues =
{
{"include", "documents"},
{"orderBy", "directoryName"}
}
};
Please use plain text.
New Member
ahoekstra
Posts: 19
Registered: 08-23-2010

Re: SData related entity "include" in Query

Thanks so much, just what I was looking for!
Please use plain text.