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> OperationsgetAll142Javapublic void getCustomer() throws RemoteException, ExceededUsageLimitFault,UnexpectedErrorFault, InvalidSessionFault, ExceededRecordCountFault {// This operation requires a valid sessionthis.login(true);// Prompt for the nsKey_console.write("\nnsKey for record to be retrieved: ");String nsKey = _console.readLn();// Invoke the get() operation to retrieve the recordRecordRef recordRef = new RecordRef();recordRef.setInternalId(nsKey);recordRef.setType(RecordType.customer);ReadResponse response = _port.get(recordRef);getAll}// Process response from get() operation_console.info("\nRecord returned from get() operation: ");if (!response.getStatus().isIsSuccess()) {_console.info("ERROR: " + getStatusDetails(response.getStatus()));} else {Customer customer = (Customer) response.getRecord();_console.info("\nnsKey="+ customer.getInternalId()+ ", "+ "\nentityId="+ customer.getEntityId()+ (customer.getCompanyName() == null ? "": ("\ncompanyName=" + customer.getCompanyName()))+ (customer.getStage() == null ? "": ("\nstage=" + customer.getStage()))+ (customer.getEmail() == null ? "": ("\nemail=" + customer.getEmail()))+ (customer.getPhone() == null ? "": ("\nphone=" + customer.getPhone()))+ "\nisInactive="+ customer.getIsInactive()+ (customer.getDateCreated() != null ? "": ("\ndateCreated=" + customer.getDateCreated().toString())));}The getAll operation is used to retrieve a list of all records of the specified type. Records thatsupport the getAll operation are listed in the GetAllRecordType, as defined in theplatformCoreType system constants XSD file.Note: You cannot use the search operation to retrieve state values. You must use thegetAll operation. The getAll operation will return all states, not just the legal ones<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!