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.

<strong>Web</strong> <strong>Services</strong> Operationssearch223C#private void searchCustomer(){// This operation requires a valid sessionthis.login( true );_out.writeLn( "\nEnter search parameters" );// Instantiate a search object for customers. Note that the search// object is different from the regular record used for add and update.CustomerSearch custSearch = new CustomerSearch();// Search the customer entity id which is a string field_out.write( "Entity ID (press enter to skip): " );String nameValue = _out.readLn();SearchStringField entityId = null;if ( !nameValue.Equals( "" ) ){entityId = new SearchStringField();entityId.@operator = SearchStringFieldOperator.contains;entityId.operatorSpecified = true;entityId.searchValue = nameValue;custSearch.basic.entityId = entityId; //see note below for an alternative}//Note: You could also use CustomerSearchBasic to access entityId directly, for example:CustomerSearchBasic custSearchBasic = new CustomerSearchBasic();custSearchBasic.entityId = entityId;// Search the customer stage which is a list field_out.write( "Customer Stage (one or more nsKeys separated by commas, press enter to skip): " );String stageKeysValue = _out.readLn();SearchMultiSelectField stage = null;if ( !stageKeysValue.Equals( "" ) ){stage = new SearchMultiSelectField();stage.@operator = SearchMultiSelectFieldOperator.anyOf;stage.operatorSpecified = true;string [] nskeys = stageKeysValue.Split( new Char[] {','} );}RecordRef[] recordRefs = new RecordRef[ stageKeysValue.Length ];for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!