Search in sources :

Example 1 with DeleteResponse

use of com.netsuite.webservices.platform.messages.DeleteResponse 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()));
    }
}
Also used : DeleteResponse(com.netsuite.webservices.platform.messages.DeleteResponse) RecordRef(com.netsuite.webservices.platform.core.RecordRef) ListOrRecordRef(com.netsuite.webservices.platform.core.ListOrRecordRef) DeleteRequest(com.netsuite.webservices.platform.messages.DeleteRequest)

Aggregations

ListOrRecordRef (com.netsuite.webservices.platform.core.ListOrRecordRef)1 RecordRef (com.netsuite.webservices.platform.core.RecordRef)1 DeleteRequest (com.netsuite.webservices.platform.messages.DeleteRequest)1 DeleteResponse (com.netsuite.webservices.platform.messages.DeleteResponse)1