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
srikanth123srikanth123 

Triggers while logging in and logging out of salesfore.

I had this crazy idea of whether we can write triggers after logging in and before logging out of salesforce. i have a requirement where in i have to check if the support person has any uncompleted tasks. if the support person is not having any uncompleted tasks then only i have to allow him to log out. Any ideas?

Bhawani SharmaBhawani Sharma

You can set your header component, where you can place your logout link. On clicking this link can all global class method to check that the user have any pending task or not. Based on the return value you can pop up an alert with the appropriate message.

bob_buzzardbob_buzzard

We tried to fire a trigger when a user logged in to Salesforce and couldn't find any way of doing that.  The home page for the app was a VF page so we added the functionality to that, but weren't 100% happy about it.

srikanth123srikanth123

one basic question. how do i change the header? is it that i have to create a new VF page for that. can you please let me know how to do this.

Bhawani SharmaBhawani Sharma

I mean , You can create a home page compoment. From this you can call a method of a global class, where you can check if all the task have been completed or not. Based on the response you can show an alert and can hide or show the logout link through javascript.