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
ryepes15ryepes15 

FIELD_INTEGRITY_EXCEPTION

Im getting the following error on my test class when i push it to production, im not sure what it needs?

OpportunityAcctPartnertest.myUnitTest(), Details: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: OpportunityId, AccountToId (account to cannot be opportunity account): [OpportunityId, AccountToId] Class.OpportunityAcctPartnertest.myUnitTest: line 38, column 1
SonamSonam (Salesforce Developers) 
Are you trying to pusha  opp line item in test class? if yes, this might be the issue you are facing:
https://help.salesforce.com/apex/HTViewSolution?id=000166658&language=en_US