You need to sign in to do that
Don't have an account?

DML code error
I created a new (boolean) field "FakeFieldTrigger__c" on the contact object, defaut value = FALSE, I would like to change the value to TRUE, but get an error.
List<Contact> recList = [SELECT Id, FakeFieldTrigger__c FROM Contact WHERE FakeFieldTrigger__c = FALSE; ];
for (Contact rec : recList) {
rec.FakeFieldTrigger__c = TRUE;
}
update recList;
Error:
Line: 1, Column: 5
Unexpected token '<'.
Can you help me update the value of this boolean field, I can then trigger my process in the process builder.
Thanks,
Dave
List<Contact> recList = [SELECT Id, FakeFieldTrigger__c FROM Contact WHERE FakeFieldTrigger__c = FALSE; ];
for (Contact rec : recList) {
rec.FakeFieldTrigger__c = TRUE;
}
update recList;
Error:
Line: 1, Column: 5
Unexpected token '<'.
Can you help me update the value of this boolean field, I can then trigger my process in the process builder.
Thanks,
Dave
This should work... Just an extra semicolon. Ona side note, this looks like something that would a great use case for the process builder. Any opportunity to do something decaritily as apposed to code would be time well spent.
Please let me know if you have any questions
Line: 22, Column: 1
System.LimitException: Apex CPU time limit exceeded
I think my code below will work on the live server.