0

I am trying to update an Account via PATCH using the endpoint: /services/data/v37.0/sobjects/Account/{Id}

Every time I try to update a field I get this error and cannot figure it out.

Checking my logs I notice that this warning is showing since July 9

Payload:

{
  "Last_Login__c":"2020-07-16T20:01:56-04:00"
}

Response Body:

{
  "errorCode" : "REQUIRED_FIELD_MISSING",
  "message" : "Required fields are missing: [Account_Status__c]",
  "fields" : [
    "Account_Status__c"
  ]
}

Response Status:

400 - Bad Request

Code:

    return salesforce.update({
      url: record.attributes.url,
      patch: {
        "Referral_Sent__c": moment().tz('America/New_York').format()
      }
    });
2
  • Error seems pretty straightforward. Account_Status__c would seem to be a required field, and it's blank (or being set to null) in your request body. If that's not enough to help you overcome the issue, it'll help to see the code you're using to generate this REST request. You can add details to your question by making an edit.
    – Derek F
    Jul 17, 2020 at 0:54
  • Hi, Derek, I updated the ask with the code used. I never had that warning before, but as of July 9 I have this message is showing in every update I send to SF. Yesterday checking my logs I notice that.
    – Argosback
    Jul 17, 2020 at 10:40

1 Answer 1

1

It sounds like this was a field that was created and set required, but not populated on all accounts. Therefore, you need to include a valid, non-null value for the account status field in your payload, or disable the required attribute on this custom field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.