use of com.netsuite.webservices.platform.messages.DeleteRequest in project tdi-studio-se by Talend.
the class NetsuiteManagement_CXF method delete.
public void delete(String entitytype, String id) throws Exception {
String typeName = TalendComponentGenerator.toInitialLower(Class.forName(entitytype).getSimpleName());
RecordRef recordRef = new RecordRef();
recordRef.setType(RecordType.fromValue(typeName));
recordRef.setInternalId(id);
DeleteRequest deleteRequest = new DeleteRequest();
deleteRequest.setBaseRef(recordRef);
DeleteResponse response = getPort().delete(deleteRequest);
if (!response.getWriteResponse().getStatus().isIsSuccess()) {
throw new NetsuiteException(getErrorCodes(response.getWriteResponse().getStatus()), getErrorMessages(response.getWriteResponse().getStatus()));
}
}
Aggregations