You need to sign in to do that
Don't have an account?
_tofu
Casting trigger.newMap
This should be easy for whoever has done this before. I have the following block of code:
for(Id errorID : projectErrorIds) {
trigger.newMap.get(errorID).Project_Stage__c.addError(System.Label.Project_Error);
}
It kicks out the following error: Field expression not allowed for generic SObject
Obviously, I need to cast it for it to work, but I don't know how. Thank you to anyone who can help!
for(Id errorID : projectErrorIds) {
((Project__c)trigger.newMap.get(errorID)).Project_Stage__c.addError(System.Label.Project_Error);
}