function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Carson HuangCarson Huang 

How to trigger when user has been freezed/unfreezed?

Hi,

I'm new to Apex so please bear with me.

Is there a way to call a trigger when a user gets freezed/unfreezed?

Basically, every time someone freezes/unfreezes a user, I want a trigger to be called that'll create a record on the change (this, I already have. I just need to be able to create a record when this change happens).

Thanks in advance!
kaustav goswamikaustav goswami
When you freeze/unfreeze an user it actually updates a record in the UserLogin object. Not on the User object.

Thus user record is in no way modified if the user is frozen.

Thus even if you have a trigger on the user object it will not fire at all.

Additionally that object is not available through the application, so you cannot add a trigger on the user login object.

You can reach out to salesforce by raising a case and stating your requirement.

If they are able to suggest you something please share it.

Thanks,
Kaustav