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
PaulDysonPaulDyson 

Triggers on user login?

Is there any way to detect user login or logout event within Apex and attach code to it (e.g. a trigger on some aspect of the User object)?

 

TIA 

SuperfellSuperfell
Sorry no.
Chirag MehtaChirag Mehta

There's a loop way around possible.

 

If your landing page on login is home page or any page where u can embed a inline scontrol sort of, then place that scontrol on that landing page and from that scontrol call the apex function 

 

For eg: Insert Scontrol as home page component and in that Scontrol call your Apex function which will perform desired tasks.

 

For logoff there's no direct and loop way around. I too tried a lot to capture user logout event for my Salesforce Chat Application. But no success :(

Message Edited by Chirag Mehta on 05-18-2009 10:18 AM