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> Operationsadd121{}status.internalId = "13";customer.entityStatus = status;// Populate the address list for this customer. You can put in as many// adresses as you like.CustomerAddressbook address = new CustomerAddressbook();address.defaultShipping = true;address.defaultShippingSpecified = true;address.defaultBilling = false;address.defaultBillingSpecified = true;address.label = "Shipping Address";address.addressee = "William Sanders";address.attention = "William Sanders";address.addr1 = "4765 Sunset Blvd";address.city = "San Francisco";address.state = "CA";address.zip = "94131";address.country = Country._unitedStates;// Attach the CustomerAddressbookList to the customerCustomerAddressbookList addressList = new CustomerAddressbookList();CustomerAddressbook[] addresses = new CustomerAddressbook[1];addresses[0] = address;addressList.addressbook = addresses;customer.addressbookList = addressList;// Invoke add() operationWriteResponse response = _service.add( customer );// Print the document id from the SOAP header//_out.info(//"\nThe add() operation with document id " + _service.documentInfo.nsID + " was processed " );// Process the responseif ( response.status.isSuccess ){_out.info("\nThe following customer was added successfully:" +"\nkey=" + ((RecordRef) response.baseRef).internalId +"\nentityId=" + customer.entityId +"\ncompanyName=" + customer.companyName +"\nemail=" + customer.email +"\nstatusKey=" + customer.entityStatus.internalId +"\naddressbookList[0].label=" + customer.addressbookList.addressbook[0].label );// Create a second customer that's a sub-customer of the first customer/*Customer subCustomer = new Customer();subCustomer.entityId = "XYZ Japan";// Set the parent customer<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!