I'm in the process of learning Apex triggers, and I've been attempting to write code that runs before updating a field.
The code should change the Primary Contact field to FALSE if the checkbox field No Longer with Company is TRUE and 'Primary Contact' is also TRUE.
However I keep running into some errors on line 3. Could someone help me understand what is missing?
Here's the code I have:
trigger UpdatePrimaryContact on Contact(before update) { for (Contact record : Trigger.new) { if (record.No_Longer_with_company__c && record.Primary_Contact__c { record.Primary_Contact__c = false; } }}