I am beginning the process of moving all of my Sampling
triggers to a utility class, and I am hitting a few snags. I have the following line of code to which I am getting the following error
Field expression not allowed for generic SObject
public void updateSamplingAE2(List<Sampling__c> sampling, Map<id,Sampling__c> oldMap) {
//doing stuff
if(Trigger.isUpdate && Trigger.oldMap.get(s.id).Product__c != s.Product__c){
//do stuff
}
}
So how do I go about treating Trigger.isUpdate and Trigger.oldMap when I am no longer using a trigger per say. I have never used a Utility class, and I want to start becoming more efficient rather than just pumping out triggers.