pretty simple question that I just can't figure. The first snippet updates a record just fine, but the second snippet does nothing, even though it compiles just fine. Many thanks.
Why does this work:
for(Pet__c P : PetList]){
if(P.Type__c == 'Cat'){
P.Age__c = 4;}
But this does not?
for(Pet__c P :[SELECT ID,
Type__c,
Age__c,
FROM Pet__c
WHERE ID IN :PetList]){
if(P.Type__c == 'Cat'){
P.Age__c = 4;}