Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Problem with Creating Cash Sale - Webservices
Hello-
Am using WSDL 2.6, having trouble creating a cash sale. Here is the error returned:
[Error]: cash sale failed 32 - [Code=INSUFFICIENT_PERMISSION] You do not have permissions to set a value for element createdfrom due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases.
This is the code - basically the sales order is passed into the function (SalesOrder so).
private void generateCashSale(SalesOrder so) { CashSale cs = new CashSale(); // create and reference original sales order RecordRef soRecordRef = new RecordRef(); soRecordRef.internalId = so.internalId; soRecordRef.type = RecordType.salesOrder; soRecordRef.typeSpecified = true; cs.createdFrom = soRecordRef; // create and reference the customer record RecordRef soEntity = new RecordRef(); soEntity.internalId = so.entity.internalId; soEntity.type = RecordType.customer; soEntity.typeSpecified = true; cs.entity = soEntity; // Note: we may need to manage the ccApproved member here - as noted by NS cs.chargeIt = true; cs.chargeItSpecified = true; WriteResponse res = _Service.add(cs); if (res.status.isSuccess) { _Out.writeLn("cash sale created " + so.tranId); updateSalesOrderExportStatus(so, "4"); } else { _Out.error("cash 0