10.07.2015 Views

SuiteTalk (Web Services) Platform Guide - NetSuite

SuiteTalk (Web Services) Platform Guide - NetSuite

SuiteTalk (Web Services) Platform Guide - NetSuite

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Setting <strong>Web</strong> <strong>Services</strong> PreferencesSetting Request Level Preferences33• Set the header (Java Only)• If executing a search, set your search preferences. To set search preferences, create aSearchPreferences object and set available search preference elements. See SettingSearch Preferences.Sample CodeSOAP RequesttruetruetruetruetrueC#In this example, a SearchPreference object is set as well as a warnAsError object. See SettingSearch Preferences for more information on the SearchPreference object.// Set up request level preferences as a SOAP headerPreferences prefs = new Preferences();_service.preferences = prefs;// Preference to ask NS to treat all warnings as errorsprefs.warningAsErrorSpecified = true;prefs.warningAsError = false;// Invoke search() web services operation_service.searchPreferences.pageSize = 20;_service.searchPreferences.pageSizeSpecified = true;SearchResult response = _service.search( custSearch );Javaprivate void setPreferences() throws SOAPException{stub = (<strong>NetSuite</strong>BindingStub) _port;stub.clearHeaders();SOAPHeaderElement prefHeader =new SOAPHeaderElement("urn:messages.platform.webservices.netsuite.com", "Preferences");Preferences prefs = new Preferences();prefs.setWarningAsError(new Boolean(false));prefs.setUseConditionalDefaultsOnAdd(new Boolean(false));prefs.setUseConditionalDefaultsOnUpdate(new Boolean(false));prefs.setDisableMandatoryCustomFieldValidation(new Boolean(true));prefs.setDisableSystemNotesForCustomFields(new Boolean(true));prefs.setIgnoreReadOnlyFields(new Boolean(true));prefHeader.setObjectValue(prefs);}stub.setHeader(prefHeader);<strong>SuiteTalk</strong> <strong>Platform</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!