function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vigitha Vasudevan 5Vigitha Vasudevan 5 

Field Integrity Exception with invalid group id on Enterprise Territory Management

 Getting error "Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: unknown (invalid user or group: 00G0v000000NzTp)" while inserting opporunity share records only on Enterprise Territory mangement(ETM) enabled sandbox.And also getting error only for group of type "Territory".Is there anything on type territory which are not allowed on share records for ETM?
 
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Vigitha,

To avoid this issue, kindly make sure the below for OpportunityLineItem(Opportunity Product) records:

1. We cannot set both TotalPrice and UnitPrice to null in the same Insert, update and Upsert call.

2. UnitPrice field or TotalPrice is required. You cannot specify both.

3. If you specify Discount and Quantity, UnitPrice field or TotalPrice is required.

4. TotalPrice field cannot be null if UnitPrice field is null.

Please refer the below link for reference. Thanks
Rahul Kumar
Vigitha Vasudevan 5Vigitha Vasudevan 5
Thanks Rahul.But the issue is on inserting opportunity share records with groupid of its type territory. And this is working fine on all sandbox(which means sandbox have Territory Management 1.0) except Enterprise Territory Management Enabled sandbox(ETM 2.0)