Loading

REST API request to update Amount on Opportunity record with Opportunity Products returns a 204 status code

Publiseringsdato: Jan 10, 2025
Beskrivelse

For Opportunities with Products, the amount is a derived field which sums of the Total Price of the related Products. Hence the Amount field is not editable for such records.

 

A REST API request to update the Amount on an opportunity record returns a 204 status code in the API response if there's no error, irrespective of the presence of related Products on the Opportunity.

 

For Opportunities with no related Products, the Amount is updated to the specified value. For Opportunities with related Products, the Amount isn't updated, it matches the sum of the total price of the associated Opportunity Products (Opportunity Line Items).

 

Example

Updating the Amount field of an Opportunity record using REST API sObject Rows:

  • URI: /services/data/v62.0/sobjects/Opportunity/<Record ID>
  • HTTP Method: PATCH
  • Body (JSON): { "Amount": 5000}

Screenshot of a REST API PATCH request to update an Opportunity record 

Status code returned is 204 as shown in the 'Raw Response' in the attached image.

Knowledge-artikkelnummer

004052228

 
Laster
Salesforce Help | Article