I am attempting to import an invoice from NetSuite into my program. In this program, I need as much information about the invoice as possible to be returned. However it does not appear that any of the line item information is being returned. Here is my piece of code I am completing for the search. Any suggestions? I am trying to complete this with as few calls out to NetSuite as possible in order to keep performance high.
SearchResult searchResults = new SearchResult();
TransactionSearch ts = new TransactionSearch();
TransactionSearchBasic tsb = new TransactionSearchBasic();
// Search for Invoices
if (_InvoiceTxnIds.Count > 0)
{
tsb.internalId = new SearchMultiSelectField();
tsb.internalId.@operator = SearchMultiSelectFieldOperator.anyOf;
tsb.internalId.operatorSpecified = true;
List<RecordRef> rrlist = new List<RecordRef>();
foreach (string sTxnId in _InvoiceTxnIds)
{
RecordRef rr = new RecordRef();
rr.internalId = sTxnId;
rrlist.Add(rr);
}
tsb.internalId.searchValue = rrlist.ToArray();
ts.basic = tsb;
searchResults = _service.search(ts);
}
I found my answer in the "Suite Talk Web Services Platform Guide":
I have included my solution and code below in case the guide become unavailable at a future date.
So I was missing setting my bodyFieldsOnly to false. Once it was set to false then I was getting back the full information desired.