How to resolve - FIELD_INTEGRITY_EXCEPTION:field integrity exception: TotalPrice (total price must be specified):TotalPrice
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.
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.