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> Operationsadd122}}else{}recordRef = new RecordRef();recordRef.internalId = ((RecordRef) response.baseRef).internalId;//recordRef.internalId = "125";subCustomer.parent = recordRef;// Invoke add() operationresponse = _service.add( subCustomer );// Process the response//"\nThe add() operation with job id " + _service.sessionInfo.jobID + " was processed " );if ( !response.status.isSuccess ){_out.info( "\nThe customer was not added:" );_out.error( getStatusDetails( response.status ) );}else{_out.info("\nThe following customer was added successfully:" +"\nkey=" + ((RecordRef) response.baseRef).internalId +"\nentityId=" + customer.entityId +"\ncompanyName=" + customer.companyName);}*/_out.error( "The customer was not added:", true );_out.error( getStatusDetails( response.status ) );Javapublic void addCustomer() throws RemoteException, ExceededRecordCountFault,ExceededUsageLimitFault, InsufficientPermissionFault, InvalidSessionFault {// This operation requires a valid sessionthis.login(true);Customer customer = new Customer();// Set entityId, company name, and emailif ("true".equals(_properties.getProperty("promptForFieldValues"))) {_console.writeLn("\nPlease enter the following customer information. "+ "Note that some fields have already been populated. ");_console.write("Entity name: ");customer.setEntityId(_console.readLn());_console.write("Company name: ");customer.setCompanyName(_console.readLn());_console.write("E-mail: ");customer.setEmail(_console.readLn());} else {customer.setEntityId("XYZ Inc");customer.setCompanyName("XYZ, Inc.");customer.setEmail("bsanders@yahoo.com");}<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!