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

apex trigger

Error: Compile Error: Variable does not exist: oldContact.ID at line 49 column 24


 if (oldContact.ID == opp.PRINCIPAL_OWNER__C)


for the above line it was showing the error 

can any one help me

Prafull G.Prafull G.
What is oldContact in your trigger context?

Share the code!
Bindhyachal Kumar SinghBindhyachal Kumar Singh

Hi vari,


can u post the trigger code.


Hi Vari,


Create a object variable named oldContact in your trigger and then write this condition checking. I think you missed declaring the variable and checked condition using that variable.


If this post solves your problem, kindly mark it as solution.