You need to sign in to do that
Don't have an account?
Error on red line "Object reference not set to an instance of an object"
I am getting error on red line "Object reference not set to an instance of an object" that doesn't makes sence for me. I know that the value is empty for gto_data.LB_Perf__c.ToString
Please help
=========================================================================
Private Function GetGTO() As Boolean
Dim qr As sforce.QueryResult
Dim queryString As String
queryString = "Select Id,Name,CreatedDate,CreatedById,Test_Type__c,Trl_Run_By__c,Dte_Run__c,Time_Spent_On_GTO__c, LB_Perf__c,Business_Status__c,Business_Status_Reason__c,Dte_Clsd__c,LB_PdNm__c from ISGTO__c"
Try
qr = binding.query(queryString)
If Not qr.records Is Nothing Then
Dim i As Integer
For i = 0 To qr.records.Length - 1
Dim gto_data As sforce.ISGTO__c
gto_data = qr.records(i)
GTO_ID_arr.Add(gto_data.Id.ToString)
GTO_NAME_arr.Add(gto_data.Name.ToString)
GTO_CREATION_DATE_arr.Add(gto_data.CreatedDate.ToString)
GTO_CREATED_BY_ID_arr.Add(gto_data.CreatedById.ToString)
TRIAL_TYPE_arr.Add(gto_data.Test_Type__c.ToString)
TRIAL_RUN_BY_arr.Add(gto_data.Trl_Run_By__c.ToString)
TRIAL_RUN_DATE_arr.Add(gto_data.Dte_Run__c.ToString)
TIME_SPENT_arr.Add(gto_data.Time_Spent_On_GTO__c.ToString)
BLADE_PERFORMANCE_arr.Add(gto_data.LB_Perf__c.ToString)
BUSINESS_STATUS_arr.Add(gto_data.Business_Status__c.ToString)
BUSINESS_STATUS_REASON_arr.Add(gto_data.Business_Status_Reason__c.ToString)
TRIAL_DATE_CLOSED_arr.Add(gto_data.Dte_Clsd__c.ToString)
TRIAL_BLADE_PRODUCT_arr.Add(gto_data.LB_PdNm__c.ToString)
Next
Else
GetGTO = False
End If
Return GetGTO
Catch ex As Exception
Console.WriteLine(ex.Message & ex.StackTrace)
Finally
End Try
End Function
BTW I think you've posted this on the wrong board. You probably want the .NET board.
so, then how I can check if it's null or not? I need the syntax.
Thanks.