Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
New Member
Posts: 1
Registered: ‎05-16-2012

SData Contact Search

Hi

 

I am new to SData.

 

What I am ultimately trying to do is search the database for a business and if it doesnt exist then insert the business into the database.

 

I have the example below working that searches for contacts with a last name starting with a but I would also like to search on company name, town, website and telephone. Please can someone tell me how I would do this.

 

Any help would be grately appreciated.

 

Willertron

 

Dim svc As ISDataService = New SDataService("http://IP:PORT/sdata/slx/dynamic/-/", "USERNAME", "PASSWORD")

            Dim req As SDataResourceCollectionRequest = New SDataResourceCollectionRequest(svc)

            req.ResourceKind = "Contacts"

            req.QueryValues.Add("where", "LastName like 'a%'")

            Dim feed As AtomFeed = req.Read()

            For Each entry As AtomEntry In feed.Entries
                Dim payload As SDataPayload = entry.GetSDataPayload()

                Dim account As String = payload.Values("AccountName").ToString
                Dim contactName As String = payload.Values("NameLF").ToString

                TextBox1.Text += account & ", " & contactName & vbCrLf
            Next

 

Copper Super Contributor
Posts: 23
Registered: ‎08-17-2009

Re: SData Contact Search

[ Edited ]

Here are some starters:


http://yourserver/sdata/slx/dynamic/-/accounts?format=json&where=AccountName like 'A%'&orderby=CreateDate desc
http://yourserver/sdata/slx/dynamic/-/accounts?format=json&where=Address.City like 'A%'&orderby=CreateDate desc
http://yourserver/sdata/slx/dynamic/-/accounts?format=json&where=Address.State eq 'TX'&orderby=CreateDate desc