2

As of Winter '21, there is a method called hasErrors() on SObjects (ref). The way to solve this problem now is to call: Account acct = new Account(); // doSomething to acct; if (!acct.hasErrors()) { // do something }


2

You simply need to use backreferences: REGEX(Name,'.*(.)\\1{3}.*') Which reads as follows: .* Any number of preceding characters ( Start numbered capture group . Any one specific character ) End numbered capture group \\1 Backreference to capture group 1 {3} Repeated 3 times (four total instances of the same character .* Any number of subsequent ...


1

If you want to bypass validation rules in certain contexts, a common approach is to use a dedicated user when running the Data Loader - let's call it data-import@myCompany.com. Then rewrite your validation rule as: $User.UserName <> 'data-import@myCompany.com' && OR( AND(MailingCountry = "Other Locations", ISPICKVAL(...


1

Validation rules are run after the before triggers have finished1, and there's no way to change that. It's part of the trigger order of execution. If your before trigger is indiscriminately changing the Account Type, then of course your validation rule won't catch anything (the trigger has changed the field value away from the problematic value before the ...


1

This could be a validation rule or a trigger. It would be on the EmailMessage object either way. I would suggest downloading the metadata for EmailMessage, ApexTrigger, ApexClass, and CustomLabel, and do a search for the error message. If you don't want to download the metadata, you can still find this in the UI, but it will be substantially more challenging ...


Only top voted, non community-wiki answers of a minimum length are eligible