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

Timestamping when an New Lead Page is opened

Anyone have a technique for getting the timestamp of when a new Lead entry page is opened and still retain the ability to use the standard Page Layout capability?


I know that this is possible if a custom VF page is constructed, but we want to use the standard Page Layout editor with Record Types, etc. 


There was a suggestion that the NOW() function could be put into a custom Lead formula field to capture when the page was opened then used in a before insert trigger to calculate the time difference, but the NOW() function seems to continuously update whenever the field is accessed.


Any suggestions would be greatly appreciated.  Thanks.


Need some clarity here:


When you say 'new lead entry page is opened', do you mean that whenever a user clicks on the new lead button a record should be created to capture the user and timestamp, regardless of whether the user saves/ cancels the new lead. If this is the case then you cannot achieve this using the triggers, as trigger are only fired on DML operation. To achieve this you have to come up with a javascript, which fires only when the URL matches with the new lead creation page and then place this in the home page component.