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
frofrik2frofrik2 

Variable does not exist on null check?

I have the following code in one of my classes:


if(adwc != null) {
       adwc.Used__c = true;
       adwc.Used_Time__c = datetime.now();
       update adwc;        
}

 

When trying to sace I just get the error "Variable does not exist: adwc" on the line with "update adwc;".

 

Any ideas why I get this error, the check is done to avoid this?



minkeshminkesh

Hello,

           Post your class code.so that we can have better idea about your error.