You need to sign in to do that
Don't have an account?
CJDEVCONPRO
Correct way to Exit Sub when no account number is found.
I am trying to query an account number and when it is found I pop open Sforce. But when it is not found, I wish to do nothing.
the problem is I am getting an instance cannot be set error. Is this the correct way to check the records from the query? (See below)
Here is the code:
qr = binding.query("select id, accountnumber from Account where accountnumber = 1")
Dim bContinue As Boolean = True
Dim loopCounter As Integer = 0
While bContinue
loopCounter += 1
lstStatus.Items.Insert(0, Now() & " " & "Results Set " & Convert.ToString(loopCounter) & " - ")
For i As Integer = 0 To qr.records.GetUpperBound(0)
Dim c As sforce.sObject = qr.records(i)
Dim accountNum As String = getFieldValue("id", c.Any)
If accountNum Is Nothing Then
'NEED CODE FOR HERE
Else
'Pop open SForce.com
End If
Code: