I am trying to create a User Trigger that has a before insert operation which is supposed to bypass a Validation Rule. But both the validation rule and the Trigger are running in different transactions, hence the validation rule is firing. Please refer below snapshot of Debug Logs: User-added image I think this has something to do with User object being a Setup Object(although i was unable to find documentation for the same).
Here is the scenario: Let's suppose there is a field Field1__c that should not be blank according to the validation rule. But i am setting the field in the before trigger. Still it is giving me the error. If i try the same approach in any other object except User, it works well. But in User object trigger is running in a different transaction(asynchronously) hence the validation rule fires asynchronously to the trigger execution and does not follow the flow of execution.