Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to 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