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

Startup event and new item event

I looked but cannot find the following:


1. When I log into Sales Force is there a startup event? Something I can run when someone logs in? Or maybe a click event on one of the tabs?

2. Create event when someone creates an item such as a task or email? I see the workflow but was not sure if it can be triggered on a new item event instead of a field event.


These seem like quite basic tasks so any help would be appreciated.


Best Answer chosen by Admin (Salesforce Developers) 

1. There's no event model for the login or UI actions but there are some tricks you can try:


a. Look at writing a Trigger on the After Update of the User object and see if you can check for update of the last login field by comparing the trigger.old and values for the field.


b. If you have a Visualforce or S-Control object on a page you can use it to trigger an action. This can either be via Apex code or you can have a simple update of a hidden field which you run a workflow off.


2. You can have a workflow on create of a new Event or Task but you can't have one on a new Email. Not sure what you mean by a 'field event', based on your other postings if you're trying to have an event on creation of new metadata then you can't do this.