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
AbAb 

Non static method cannot be referenced from a static context: void ContractTriggerHandler.OnAfterUpdate

Hello,

I have below error, what can be reason:

Non static method cannot be referenced from a static context: void ContractTriggerHandler.OnAfterUpdate(List<Contract>, List<Contract>, Map<Id,Contract>, Map<Id,Contract>)

Any suggestions ?
Best Answer chosen by Ab
Alain CabonAlain Cabon
If the method OnAfterUpdate is not static, the call must done by using an instance created with "new myObjectName ()".

ContractTriggerHandler cth = new ContractTriggerHandler( ... perhaps with some parameters ... );

cth.OnAfterUpdate( ...);