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

Need to capture the time at which the NEW button was clicked.Can any one help me how to do this?

Hello All,


Can any one help me how to do this?


Need to capture the time at which the NEW button was clicked. 
Need to capture the time at which SAVE button was clicked. Write a custom script for the SAVE button to calculate the difference between time taken to click NEW and SAVE.


Thanks in advance.




You would need to develop a Visualforce page. In the constructor, note the time it was called in a variable. You can save this to a custom field. System can automatically calculate the time spent using the formula CreatedDate-NewButtonClickTime__c; multiply by 24 to show hours or 1440 for minutes or 86400 to show seconds.


Hello ,


We are using stadardpage ,so I have created custom button.When we click the button ,by using URL it automatically assigns current time value,Upto now everything is fine.


But,If we make the field readonly,hidden or remove from pagelayout the field is not populating with data.


I have used the following url to set value to the field




Can you suggest how to get the value in to the field.


Thanks in Advance






You won't be able to make it hidden/read-only, as that will cause it to not record that data. You will need a Visualforce page, as I stated earlier.