2

I was trying to update the approval status of a vendor bill record in NetSuite using NetSuite SOAP API SDK for Java. I am using 2017_2 WSDL.

RecordRef approvalStatus = new RecordRef();
approvalStatus.setName("approved");

VendorBill bill = new VendorBill();
bill.setExternalId("MY EXT ID");
bill.setApprovalStatus(approvalStatus);
bill.setMemo("From test " + System.currentTimeMillis());

WriteResponse response = client.callUpdateRecord(vendorBill);
logger.info(response.getStatus().isIsSuccess());

I was able to modify fields like MEMO, but not approval_Status field. The update API call is succeeding, but record is not getting updated.

I am using the API tokens belongs to an administrator user. I am able to perform the operation using UI.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Nikhil K R
  • 677
  • 1
  • 9
  • 19

1 Answers1

1

I found the solution. Instead of setName("approved"), use internal id.

RecordRef approvalStatus = new RecordRef();
approvalStatus.setInternalId("2");
Nikhil K R
  • 677
  • 1
  • 9
  • 19