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
priyanka.mv26priyanka.mv26 

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 : https://trailblazers.salesforce.com/answers?id=9063A000000piHnQAI 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: https://salesforce.stackexchange.com/questions/9926/execute-an-action-run-a-trigger-every-time-a-user-logs-in-to-salesforce

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.

Regards,
Anutej