You need to sign in to do that
Don't have an account?

how to capture time on visualforce in salesforce
Here is my requirement
1)In a day we have 2 sessions.In the morning session once click on[clock IN Button] Time starts counting.
2)In the lunch time if i click on [click Pause button] it should stop recording the time.
3)On a Click of log out at evening[click logout button] . On the same click of logout button insert the record taking difference of duration and also use user info to identify the User in a custom object
So that we can calculate the Employees productive hours of working.
How can i Achieve this Functionality in salesforce
Please Share the Ideas.
1)In a day we have 2 sessions.In the morning session once click on[clock IN Button] Time starts counting.
2)In the lunch time if i click on [click Pause button] it should stop recording the time.
3)On a Click of log out at evening[click logout button] . On the same click of logout button insert the record taking difference of duration and also use user info to identify the User in a custom object
So that we can calculate the Employees productive hours of working.
How can i Achieve this Functionality in salesforce
Please Share the Ideas.
You can create or update this record based on the current date and the active users User Id.
You could take this a step further and add formula fields to easily find the hours worked for that day.
Thanks for your reply
I have created a session object (Master-detail-relationship) with user object.
I have created the following fields on the object :
User Name (master-detail relationship)
login time (Date/Time Field)
Logout Time (Date/Time Field)
Total Hours ( Formula "which will take the values from the two date fileds and calculate the hours )
How would i insert a record in to "session" object automatically when the user log in to the salesforce instance (Login Time) and as well as the logout time needs to be populated when the user logs out.
can you please provide me some example /logic
Thanks
Praveen
I thought the original intention was they would press a button to login/logout. If that was the case a simple Visualforce page would work.
You might be better off using the Event Monitoring API (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/using_resources_event_log_files.htm). There are Login and Logout events that you can monitor to get the data (as long as users explicitly logout of Salesforce)
See also: Execute an action / run a trigger every time a User logs in to Salesforce
I have mis lead you I guess.I need to create a visualforce page with a colck having (Buttons:Start,Stop,Pause).when the user click start ,the start time login time (Date/Time Field) needs to be recorded and when the usr clicks stop the stop time needs to be inserted (
Logout Time (Date/Time Field)
They should be inserted a record in the custom object called session.
Thanks
Praveen
I feel like it should be done with counter and saving the time in text field.
or you can completely do it JS and save that value to the text field in salesforce, using ajax api.