12-03-2009 08:45 AM
I'm developing a tool which brings the contact data in SLX using the sdata xml templates.
In 7.5.1 I've been successful doing this with the currect code
If Not xmldoc Is Nothing Then
atom = XNamespace.Get("http://www.w3.org/2005/Atom")
Dim account As System.Xml.Linq.XElement = (From entry In xmldoc.Descendants(atom + "entry") Select entry).First
account.Element(atom + "Company").Value = Company
But with 7.5.2 I always receive an "Object not set to an instance of an Object" issue but I can't find the reason why this is happening.
I've compared this with an example for the new SLX version but I didn't find the solution for this.
Maybe you can provide me a simple example how to create a new lead over the new sdata?
There have been a few example codes for 7.5.1, so I hope there would be something similiar for 7.5.2
Thanks in advance
12-03-2009 10:07 AM
FYI.. the URI has changed w/teh release of 7.5.2 since it's in 7.5.2 that SData became the 1.0 release. pre 7.5.2 you were working w/version .9 SData.
Also, there's a bug in 7.5.2 SData where it will fail if the Entity is a "private" ownership (SECODEID = a userID).
12-04-2009 08:07 AM
I've spend a little time today in trying to get it up and running.
I'm able to create new leads over the sdata template, but somehow the date aren't sent completely to slx.
It's creating an empty lead but is not filling the values which I've written into the template into the fields.
I'm using this class for my simple test
Public Class SLX752
Public client As New WebClient
Public downloadresult As String = ""
Public xmldoc As New System.Xml.Linq.XDocument
Public etag As String
ReadOnly cf As XNamespace = XNamespace.Get("http://www.microsoft.com/schemas/rss/core/2005")
ReadOnly atom As XNamespace = XNamespace.Get("http://www.w3.org/2005/Atom")
ReadOnly slx As XNamespace = XNamespace.Get("http://schemas.sage.com/dynamic/2007")
ReadOnly sdata As XNamespace = XNamespace.Get("http://schemas.sage.com/sdata/2008/1")
ReadOnly xhttp As XNamespace = XNamespace.Get("http://schemas.sage.com/sdata/http/2008/1")
Public Sub test()
client.BaseAddress = "http://192.168.5.191:81/sdata/slx/dynamic/-/leads"
client.Encoding = System.Text.Encoding.UTF8
client.Credentials = New NetworkCredential("Admin", "")
Dim result As String = client.DownloadString("http://192.168.5.191:81/sdata/slx/dynamic/-/leads('Q6UJ99XXYEQQ')")
If result(0) = CChar(ChrW(65279)) Then
result = result.Substring(1)
xmldoc = XDocument.Load(New StringReader(result))
Dim entries As System.Xml.Linq.XElement = (From Entry In xmldoc.Descendants(atom + "entry") Select Entry).First()
etag = entries.Element(xhttp + "etag").Value
Dim address As System.Xml.Linq.XElement = (From Entry In xmldoc.Descendants(slx + "Lead") Select Entry).First()
address.Element(slx + "Company").Value = "company"
address.Element(slx + "FirstName").Value = "firstname"
address.Element(slx + "LastName").Value = "lastname"
Dim putPayload As String = " " & address.ToString() & " "
client.UploadString("leads", "POST", putPayload)
Catch ex As Exception
It's running through the whole function but when I check back in SLX there is only a new empty lead record. I do not receive any error in the code or while uploading.
Maybe there is some kind of example code to create/update leads and contacts?
Thanks for the help.
12-04-2009 08:17 AM
My own libraries arecompletely different than yours...
There's some SData examples at SageU.com in the developer's subscription. If you don't have the subscription I suggest you obtain it. The subscription is (your) company wide and for a year.
12-07-2009 03:42 AM
"Also, there's a bug in 7.5.2 SData where it will fail if the Entity is a "private" ownership (SECODEID = a userID)."
12-07-2009 05:07 AM
It's a bug. For over 12 years we have been able to have Private Contacts (Contacts where the SECCODEID = UserId). The web has just not caught up in this area to the LAN/Windows product.
If you look at my additional posts (over the weekend) in the Global Partner's Lounge you will see I've posted on several bugs related to this (Datagrid OWNER format problem, filter problem, etc....).
12-07-2009 05:29 AM
12-07-2009 07:20 AM
12-07-2009 07:40 AM
LOL. It isn't harming me
Reminds me of a guy that integrated audiology testing equipment with a product called Commence. He had an app written that streamed binary testing results data into a Commence field, which was then supposed to synchronize back to the server. While I believe he had some success for awhile, things changed
12-18-2009 08:34 AM
it's me again. I'm working with the new slx at the moment and expiriencing the new functionality of the new Sdata.
I have one question. I'm developing in vb.net. I want to create new contacts with the contact templates.xml
Now I always receive the error message "Internal Server Error" when posting the xml back to slx.
So what I think is that I have to add the AccountID to whcih the contact should be linked. I found out that this has to be written into the Attributes of the Account field in the xml template.
Now how can I write something into the Attributes as I always receives error messages when trying to do so.
This is the Account line as I receive it when downloading an existing contact over my app:
<slx:Account sdata:key="A6UJ9A000027" sdata:uri="http://192.168.5.191:81/sdata/slx/dynamic/-/accounts('A6UJ9A000027')" sdata:uuid="00000000-0000-0000-0000-000000000000" />
So I think that I have to fill the attribute "adata:key=" to create a new contact.
Does someone has an idead what I have to do to edit the attributes of a specific element in the xmls payload?
I would be very thankful if someone has a short code example which I can use to finish my app.
thanks in advance and have a nice weekend.