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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Web</strong> <strong>Services</strong> Operationsupsert263Sample CodeSOAP RequestXYZ 2 IncXYZ 2, Inc.bsanders@xyz.comSOAP ResponseC# (.NET)private void upsertCustomer(){// This operation requires a valid sessionthis.login( true );Customer customer = new Customer();// Get externalId for upsert_out.write( "\nEnter externalId for customer record to be created or updated : " );customer.externalId = _out.readLn().ToUpper();// Set name and emailcustomer.entityId = "XYZ 2 Inc";customer.companyName = "XYZ 2, Inc.";customer.email = "bsanders@xyz.com";// Invoke upsert() operationWriteResponse response = _service.upsert( customer );// Process the responseif (response.status.isSuccess ){_out.info("\nThe upsert operation was successful :" +"\ninternalId=" + ((RecordRef) response.baseRef).internalId +"\nexternalId=" + ((RecordRef) response.baseRef).externalId +"\nentityId=" + customer.entityId +<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!