Here is a curious case:
We set up an API search on a custom field with the following code:
------------------------------
CustomerSearch asi = new CustomerSearch(); CustomerSearchBasic asb = new CustomerSearchBasic(); asb.isInactive = new SearchBooleanField(); asb.isInactive.searchValue = false; asb.isInactive.searchValueSpecified = true; SearchLongCustomField ssf = new SearchLongCustomField(); ssf.@operator = SearchLongFieldOperator.equalTo; ssf.searchValue = 746; ssf.operatorSpecified = true; ssf.internalId = "custentityvsiteid"; ssf.searchValueSpecified = true;
------------------------------Since we set searchValue EQUAL TO 746, we only expect 1 record. Typically we set it to > 0 so we get an entire customer list. However, because of the strange thing happening, we set it to 746 in our example.Now.. here is the SOAP request and response from the above search:------------------------------<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body> - <search xmlns="urn:messages_2_6.platform.webservices.netsuite.com"> - <searchRecord xsi:type="q1:CustomerSearch" xmlns:q1="urn:relationships_2_6.lists.webservices.netsuite.com"> - <q1:basic> - <isInactive xmlns="urn:common_2_6.platform.webservices.netsuite.com"> <searchValue xmlns="urn:core_2_6.platform.webservices.netsuite.com">false</searchValue> </isInactive> - <customFieldList xmlns="urn:common_2_6.platform.webservices.netsuite.com"> - <customField operator="equalTo" internalId="custentityvsiteid" xsi:type="SearchLongCustomField" xmlns="urn:core_2_6.platform.webservices.netsuite.com"> <searchValue>746</searchValue> </customField> </customFieldList> </q1:basic> </searchRecord> </search> </soap:Body> </soap:Envelope>
--------------------------------------<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <soapenv:Header> - <ns1:documentInfo xmlns:ns1="urn:messages_2_6.platform.webservices.netsuite.com"> <ns1:nsId>WEBSERVICES_633551_0927200815455387491427311065_373027d72ebd</ns1:nsId> </ns1:documentInfo> </soapenv:Header> - <soapenv:Body> - <searchResponse xmlns="urn:messages_2_6.platform.webservices.netsuite.com"> - <ns2:searchResult xmlns:ns2="urn:core_2_6.platform.webservices.netsuite.com"> <ns2:status isSuccess="true" /> <ns2:totalRecords>1</ns2:totalRecords> <ns2:pageSize>1000</ns2:pageSize> <ns2:totalPages>1</ns2:totalPages> <ns2:pageIndex>1</ns2:pageIndex> - <ns2:recordList> - <ns2:record xsi:type="ns3:Customer" externalId="ENTITY641" internalId="641" xmlns:ns3="urn:relationships_2_6.lists.webservices.netsuite.com"> <ns3:entityId>Quent Cordair Fine Art</ns3:entityId> <ns3:companyName>Quent Cordair Fine Art</ns3:companyName> - <ns3:entityStatus internalId="13"> <ns2:name>ACCOUNT-Closed Won</ns2:name> </ns3:entityStatus> <ns3:phone>650.344.1134</ns3:phone> <ns3:email>xxx@cordair.com</ns3:email> <ns3:defaultAddress>Quent Cordair Fine Art<br>xxx<br>Burlingame CA 94010<br>United States</ns3:defaultAddress> <ns3:isInactive>false</ns3:isInactive> - <ns3:category internalId="1"> <ns2:name>Hosted</ns2:name> </ns3:category> <ns3:dateCreated>2006-08-06T00:16:00.000-07:00</ns3:dateCreated> <ns3:emailPreference>_default</ns3:emailPreference> - <ns3:salesRep internalId="1"> <ns2:name>Alex Bloom</ns2:name> </ns3:salesRep> - <ns3:terms internalId="3"> <ns2:name>Due on receipt</ns2:name> </ns3:terms> <ns3:unbilledOrders>449.55</ns3:unbilledOrders> <ns3:giveAccess>false</ns3:giveAccess> - <ns3:leadSource internalId="6618"> <ns2:name>141 No Campaign</ns2:name> </ns3:leadSource> <ns3:webLead>No</ns3:webLead> <ns3:unsubscribe>false</ns3:unsubscribe> <ns3:billPay>false</ns3:billPay> <ns3:lastModifiedDate>2008-09-27T04:36:00.000-07:00</ns3:lastModifiedDate> <ns3:stage>_customer</ns3:stage> - <ns3:customFieldList> - <ns2:customField xsi:type="ns2:BooleanCustomFieldRef" internalId="custentitytrialtypeenterprise"> <ns2:value>false</ns2:value> </ns2:customField> - <ns2:customField xsi:type="ns2:BooleanCustomFieldRef" internalId="custentityvwantstraining"> <ns2:value>false</ns2:value> </ns2:customField> </ns3:customFieldList> </ns2:record> </ns2:recordList> </ns2:searchResult> </searchResponse> </soapenv:Body> </soapenv:Envelope>
Now, the interesting thing is this: If you look above, the record that is returned obviously has the custom field set to the value we are looking for, since it is returned in the result (and if we look at the record in netsuite, it does as well). However, if you look at the custom field list in the result, it does not contain the custom field as part of the record.