You need to sign in to do that
Don't have an account?
Lets Try that again... binding.QueryOptionsValue
Dont know what just happened, but let me try and repost...
I have a wierd error that i am getting. I am using proper syntax (i think) when trying to run a query on salesforce data. When it gets to the binding.queryoptionsvalue = ... line, it returns with the following error
"Object refrence not set to the instance of an object"
I am loggin in, and am using a code snippet i have used before... any hep is greatly appreciated.
Environment ( 5.0 API, VB.net)
Thanks in advance
Josh
CODE SNIPET
login()
Dim ownerName As String = owner
Dim Soql As String = "select Id from user where email = '" & ownerName & "'"
Dim idr As Salesforce.QueryResult = Nothing
binding.QueryOptionsValue = New Salesforce.QueryOptions <---------------- Fails Here
idr = binding.query(Soql)
Dim id_i As Integer = 0
If idr.size > 0 Then
For id_i = 0 To idr.records.GetUpperBound(0)
Dim a_i As Salesforce.User = CType(idr.records(id_i), Salesforce.User)
ownid = a_i.Id
Next
End If
working from memory here,
queryOptions is set in the soap header , not a seperate object
so, in VB you may want to try :
Salesforce.SetSoapHeader section, name, value
or --> Salesforce.SetSoapHeader("QueryOptions", "batchSize", "1")
for a normal query this is NOT required because the toolkit handles all the query & query more stuff, so even the above may not work as you expect.
remember the officetoolkit is not exactly the same as the API, use the object Browser in VB / VBA to see what objects exist, Salesforce.QueryOptions does not.
The problem is, i have used that syntax for over a year and never had any problems. Could there have been a change i the summer re;ease that would cause this?
Thanks
Josh
Hey Josh,
Give me a little more background, did you recently change an endpoint, refresh the wsdl or anything like that? Is you binding instantiated? Are trying to multi thread?
I grabbed the latest wsdl from our site. I ussualy do that everyime i write/rewrite a salesforce application. In terms of the initiating the binding everyhting that would normaly work is in the code in the first post. I ussualy dont have any issues. No multithreading realy takes place. Login() is in a seperate module where I keep my globals. Other than that, there is nothing strange about the process. In regards toi what i am trying to do, I am simply trying to retrieve the salesforce owner ID using their email... This should not be too difficult a task, but it wants to bang its head on a wall it seems. It is quite possible there is something external closing my login session, but other than that, I wouldnt know.
Thanks
Josh
Makes senese... let me look at it a little further...
Thanks
Josh