c# - NetSuite Transaction Search Returned Without Any Line Items for Invoice -
i attempting import invoice netsuite program. in program, need information invoice possible returned. not appear of line item information being returned. here piece of code completing search. suggestions? trying complete few calls out netsuite possible in order keep performance high.
searchresult searchresults = new searchresult(); transactionsearch ts = new transactionsearch(); transactionsearchbasic tsb = new transactionsearchbasic(); // search 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 answer in "suite talk web services platform guide":
suitetalkwebservicesplatformguid_2012.1.pdf (page 34, setting search preferences.)
i have included solution , code below in case guide become unavailable @ future date.
bodyfieldsonly
boolean
defaults true , indicates information in body fields of record returned — improving performance. fields in associated lists or sublists not returned. if bodyfieldsonly field set false, fields associated record returned.
so missing setting bodyfieldsonly false. once set false getting full information desired.
/// <summary> /// <p>this function builds pereferences , searchpreferences in soap header. </p> /// </summary> private void setpreferences() { // set request level preferences soap header _prefs = new preferences(); _service.preferences = _prefs; _searchpreferences = new searchpreferences(); _service.searchpreferences = _searchpreferences; // preference ask ns treat warnings errors _prefs.warningaserrorspecified = true; _prefs.warningaserror = false; _searchpreferences.pagesize = _pagesize; _searchpreferences.pagesizespecified = true; // setting bodyfieldsonly true faster search times on opportunities _searchpreferences.bodyfieldsonly = false; }
Comments
Post a Comment