Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
New Member
Posts: 17
Registered: ‎09-10-2009

SLX 7.5.2 Fill Sdata xmls

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

 

Kai

Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: SLX 7.5.2 Fill Sdata xmls

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.

 

Example..

Before:

   http://localhost/sdata/slx/dynamic/Accounts

Now:

  http://localhost/sdata/dynamic/-/Accounts

 

 

Also, there's a bug in 7.5.2 SData where it will fail if the Entity is a "private" ownership (SECODEID = a userID).

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Highlighted
New Member
Posts: 17
Registered: ‎09-10-2009

Re: SLX 7.5.2 Fill Sdata xmls

Hi RJ,

 

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

 

Imports System.Net
Imports System.IO

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()
        Try
            client.BaseAddress = "http://192.168.5.191:81/sdata/slx/dynamic/-/leads"
            client.Encoding = System.Text.Encoding.UTF8
            client.Headers.Add(HttpRequestHeader.ContentType, "application/atom+xml")
            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)
            End If
            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.Headers.Clear()
            client.Headers.Add(HttpRequestHeader.ContentType, "application/atom+xml;type=entry")
            client.Headers.Add(HttpRequestHeader.IfMatch, etag)

            client.UploadString("leads", "POST", putPayload)

        Catch ex As Exception
            Logging(ex.ToString)
        End Try
    End Sub

End Class

 

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.

 

Regards

 

Kai

 

 

Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: SLX 7.5.2 Fill Sdata xmls

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.

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Highlighted
Bronze Elite Contributor
Posts: 402
Registered: ‎07-13-2009

Re: SLX 7.5.2 Fill Sdata xmls

"Also, there's a bug in 7.5.2 SData where it will fail if the Entity is a "private" ownership (SECODEID = a userID)."

 

Have you confirmed that Sage agrees this is a bug? Since they took this 'feature' out of the user interface, they may consider that an unsupported hack  :manwink:

 

Just sayin....

 

Begin <rant>

Mike Boysen - Blytheco

www.blytheco.com | www.blythecodev.com | bMobile
Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: SLX 7.5.2 Fill SData xmls

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....).

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Highlighted
Bronze Elite Contributor
Posts: 402
Registered: ‎07-13-2009

Re: SLX 7.5.2 Fill SData xmls

The LAN "used to" facilitate this and then they removed it for some reason.  So, they either wanted to discontinue the feature or they made a boo boo. There are all kinds of things "you can do" that they may not necessarily support in the future. All I'm saying is that making this a priority if they purposely removed the UI functionality may be challenging.
Mike Boysen - Blytheco

www.blytheco.com | www.blythecodev.com | bMobile
Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: SLX 7.5.2 Fill SData xmls

Well.. It "breaks" existing SalesLogix implementations. It's a violation of the basic rule"... do no harm... 

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Highlighted
Bronze Elite Contributor
Posts: 402
Registered: ‎07-13-2009

Re: SLX 7.5.2 Fill SData xmls

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 Smiley Happy

Mike Boysen - Blytheco

www.blytheco.com | www.blythecodev.com | bMobile
Highlighted
New Member
Posts: 17
Registered: ‎09-10-2009

Re: SLX 7.5.2 Fill Sdata xmls

Hi Guys,

 

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.

 

Kai