How to resolve - FIELD_INTEGRITY_EXCEPTION:field integrity exception: TotalPrice (total price must be specified):TotalPrice

723    Asked by DavidEdmunds in Salesforce , Asked on Feb 28, 2023

 I'm getting the following exception while updating a custom field on Opportunity Product. FIELD_INTEGRITY_EXCEPTION:field integrity exception: TotalPrice (total price must be specified):TotalPrice


Details: custom_field__c is a checkbox field.

From the UI when custom_field__c value is made to true this field integrity exception is thrown. But when i try to update custom_field__c from developer console it is saved without any exception.


TotalPrice, UnitPrice, SalesPrice and Quantity values are already present on the record.


I would like to do a mass update for custom_field__c on Opportunity Products. Any kind of help is appreciated.

Answered by elonjigar

To avoid this issue, kindly make sure the below for OpportunityLineItem(Opportunity Product) records: We cannot set both TotalPrice and UnitPrice to null in the same Insert, update and Upsert call. UnitPrice field or TotalPrice is required. You cannot specify both. If you specify Discount and Quantity, UnitPrice field or TotalPrice is required. TotalPrice field cannot be null if UnitPrice field is null.



Your Answer

Answer (1)

To resolve the FIELD_INTEGRITY_EXCEPTION: Field Integrity Exception: TotalPrice (Total Price Must Be Specified): TotalPrice error, follow these steps:

  1. Specify the TotalPrice: Ensure that the TotalPrice field is populated with a valid value when creating or updating the record.
  2. Check Field Permissions: Verify that you have the necessary permissions to set the TotalPrice field.
  3. Validation Rules: Review any validation rules that might be enforcing the requirement for the TotalPrice field.

By ensuring the TotalPrice field is correctly populated, the error should be resolved.








3 Months

Interviews

Parent Categories