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> Operationsget141.http://maps.google.comC#private void getCustomer(){// This operation requires a valid sessionthis.login( true );// Prompt for the nsKey_out.write( "\nnsKey for record to be retrieved: " );String nsKey = _out.readLn();// Invoke the get() operation to retrieve the recordRecordRef recordRef = new RecordRef();recordRef.internalId = nsKey;recordRef.type = RecordType.customer;recordRef.typeSpecified = true;ReadResponse response = _service.get( recordRef );}// Process response from get() operation_out.info( "\nRecord returned from get() operation: " );if ( !response.status.isSuccess ){_out.info("ERROR: " +getStatusDetails( response.status ) );}else{Customer customer = (Customer) response.record;_out.info("\nnsKey=" + customer.internalId + ", " +"\nentityId=" + customer.entityId +(customer.companyName==null ? "" : ("\ncompanyName=" + customer.companyName)) +(customer.stage==null ? "" : ("\nstage=" + customer.stage)) +(customer.email==null ? "" : ("\nemail=" + customer.email)) +(customer.phone==null ? "" : ("\nphone=" + customer.phone)) +"\nisInactive=" + customer.isInactive +(!customer.dateCreatedSpecified ? "" : ("\ndateCreated=" +customer.dateCreated.ToShortDateString())) );}<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!