Need some help getting started

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
rflud
Posts: 5
Joined: Wed Nov 06, 2013 5:35 am

Need some help getting started

Post by rflud » Wed Nov 06, 2013 6:34 am

Can anyone help me get started? I am trying to get a connection to the web API for Autotask. I'd like to just make a simple stack with a login button and then a query button with an output list. I have all of the sample code to make this happen but I'm unsure how to get going in LC. For some reason the forum won't let me post the code. I can send it to you. Thanks in advance.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Need some help getting started

Post by dunbarx » Wed Nov 06, 2013 3:09 pm

Hi.

I seem to remember that there is a minimum number of posts required before you can attach a file, but do not think there is one preventing you from using the "

Code: Select all

" tags. If I am wrong, though, simply post it in the clear, as text.

Craig Newman

rflud
Posts: 5
Joined: Wed Nov 06, 2013 5:35 am

Re: Need some help getting started

Post by rflud » Wed Nov 06, 2013 4:53 pm

Thanks. No matter if it's plain text or within the "code" I get this when I try to post - Your account does not have permission to post links or domain/page references.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Need some help getting started

Post by dunbarx » Wed Nov 06, 2013 5:49 pm

But you are posting already. Did you mean you could not attach a file when you said you could not post "code"?

Craig

rflud
Posts: 5
Joined: Wed Nov 06, 2013 5:35 am

Re: Need some help getting started

Post by rflud » Wed Nov 06, 2013 5:52 pm

I can post regular text but if I try to put in the sample code I have it gives me this error when I try to click to submit. I can just email it to you if you'd like.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Need some help getting started

Post by Simon » Wed Nov 06, 2013 10:20 pm

There is a URL in rflud code.
Can't post it yet or change the url to w w w . s o m e. c o m (spaces between the letters).

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

rflud
Posts: 5
Joined: Wed Nov 06, 2013 5:35 am

Re: Need some help getting started

Post by rflud » Wed Nov 06, 2013 10:25 pm

I found the lines that were causing the problem. I noted them with "**************" I had to add a space after the periods and break up the URL.

Dim strWebURI As String = "h t t p s: / / webservices5 . autotask . net / atservices / 1 . 5 / atws . wsdl" *******************
Dim myService As New WebReference.ATWS
myService.Url = strWebURI
Dim cred As New System. Net. NetworkCredential("myUserName at domain . com", "myPassword") *******************
Dim credCache As New System. Net. CredentialCache ***********************
credCache.Add(New Uri(myService.Url), "Basic", cred)
myService.Credentials = credCache

and here is the code to run a query for accounts.

Dim boolQueryFinished = False
Dim strCurrentID As String = "0"
While Not (boolQueryFinished)
Dim strQuery As String = "<queryxml><entity>Account</entity>" & _
"<query><field>id<expression op=""greaterthan"">" & strCurrentID & "</expression></
field></query>" & _
"</queryxml>"
Dim r As myWS.ATWSResponse
r = myService.query(strQuery)
If r.EntityResults.Length > 0 Then
For Each ent As myWS.Entity In r.EntityResults
' execute some code on the current account
Console.WriteLine(CType(ent, myWS.Account).AccountName)
Console.WriteLine(ent.id)
strCurrentID = ent.id
Next
Else
boolQueryFinished = True
End If
End While

rflud
Posts: 5
Joined: Wed Nov 06, 2013 5:35 am

Re: Need some help getting started

Post by rflud » Thu Nov 07, 2013 10:35 pm

Can anyone turn this code into a working stack? Or at least point me in the right direction?

Post Reply