Using SData from a Separate .NET 2.0 DLL in SalesLogix Web

Question: I would like to click a link button in a GridView, have that bring up the SalesLogix Web contact portal page, and have the contact in the details view.  Is it possible to use SData from a separate .NET 2.0 DLL?

Answer: You can certainly do this, see below:

WebClient client = new WebClient();

client.Encoding.UTF8;
client.Credentials = new NetworkCredential(“SLXUser”, “SLXPassword”);

client.Headers.Clear();
client.Headers.Add(HttpRequestHeader.ContentType, “application/atom+xml”);

string result = client.DownloadString(http://server:port/sdata/slx/dynamic/contacts(contactid);

if (result[0] == (Char)65279)
{
result = result.Substring(1);
}

XElement contact = XDocument.Load(new StringReader(result)).Descendants(ATOM + “entry”).First();

In the ‘contact’ variable you have all the data from the sdata portal.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!