I am getting an error message on a trigger that was working until recently. The issue arises on a trigger that inserts an OpportunityLineItem on an Opportunity. Here is the error:
Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: unknown (pricebook entry is in a different pricebook than the one assigned to the opportunity):
Here is my confusion - I have a hard coded PriceBook Entry ID in the code (for now). But this id is drawn from the correct pricebook. To check myself, I was able to manually add an Opportunity Product and I display the Pricebook ID (via formula field). It is the same value. Any thoughts? Thanks