Discussions
Updating Custom Record causes FIELD_PARAM_REQD error
Hi,
I'm updating an existing CustomRecord where the object I'm providing within the code contains the following fields:
- RecType, by providing its id
- The internal id of the custom record
- Boolean custom field within the custom field list.
Unfortunately I'm getting FIELD_PARAM_REQD error response with the message: "Please enter a value for Name".
Tried to supply a name for the Rectype / CustomRecord (Although it makes no sense) but still getting the same result.
The code:
public void updateIsProcessFieldOnPaymentFile(CustomRecord originalCustomRecord) throws NetsuiteException { // Copy original unchanged properties CustomRecord updatedCustomRecord = new CustomRecord(); RecordRef recordRef = new RecordRef(); recordRef.setInternalId(originalCustomRecord.getRecType().getInternalId()); updatedCustomRecord.setRecType(recordRef); updatedCustomRecord.setInternalId(originalCustomRecord.getInternalId()); // Update the field ArrayList<CustomFieldRef> customFields = new ArrayList<CustomFieldRef>(); BooleanCustomFieldRef booleanCustomFieldRef = new BooleanCustomFieldRef(); booleanCustomFieldRef.setValue(true); booleanCustomFieldRef.setScriptId("custrecord_imperva_file_is_processed"); customFields.add(booleanCustomFieldRef); // Add field to record CustomFieldList customFieldList = new CustomFieldList(); customFieldList.setCustomField(customFields.toArray(new CustomFieldRef[customFields.size()])); updatedCustomRecord.setCustomFieldList(customFieldList); // Update netsuite WriteResponse writeResponse = null; try { writeResponse = updateRecord(updatedCustomRecord); } catch (Exception e) { LOG.error("Couldn't update NetSuite Payment File with id: " + updatedCustomRecord.getInternalId()); throw new NetsuiteException("Couldn't update NetSuite Payment File with id: " + updatedCustomRecord.getInternalId()); } if (!writeResponse.getStatus().isIsSuccess()) { StatusDetail[]