Hi,
I am trying to do a customer search based on a custom customer field(custentity13). The custom field is an integer field. I'm working with VB.net, basically I want the customer object if the value in the custom field exists in the customer records. Here's what I'm attempting, but it is returning nothing as the search result, any help is appreciated!:
Function Customer_Exists(ByRef oService As netsuite.webservices.NetSuiteService, ByVal strCustID As String, ByRef oCustomer As netsuite.webservices.Customer) As Boolean
Dim cs As New netsuite.webservices.CustomerSearch, csb As New netsuite.webservices.CustomerSearchBasic, _
oCustID As New netsuite.webservices.SearchLongCustomField, oInactive As New netsuite.webservices.SearchBooleanField, _
oCustomers(1) As netsuite.webservices.SearchLongCustomField
oCustID.operator = netsuite.webservices.SearchStringFieldOperator.is
oCustID.operatorSpecified = True
oCustID.searchValue = CLng(strCustID)
oCustID.internalId = "custentity13"
oInactive.searchValue = False
oInactive.searchValueSpecified = True
oCustomers(0) = oCustID
csb.customFieldList = oCustomers
csb.isInactive = oInactive
cs.basic = csb
Dim oResult = New netsuite.webservices.SearchResult
oResult = oService.search(cs)
Dim strRecords As netsuite.webservices.Record()
strRecords = oResult.recordList
If strRecords.Length > 0 Then
oCustomer = strRecords(0)
Return True
Else
Return False
End If
End Function