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

Can we execute a custom trigger logic on user login (both UI login and API login)

ANUTEJANUTEJ (Salesforce Developers) 
Hi Priyanka,

As mentioned in this link : you can have login flows that execute whenever a user logs in and for a way to execute apex code you can use the implementation mentioned in this link:

Let me know if there are any questions and in case if this comes in handy can you please choose this as the best answer so that it can be used by others in the future.