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
VANAPARTHI SRIKANTHVANAPARTHI SRIKANTH 

Auto Calculation of time

Hi All,

I would like to create a button such that if a button is pressed so that a field is auto populated. can we achive it.if possible please help me out.

and can we create a field that which can track time and in the formate of (04:45:05) i mean including minutes and second also where as now() returns only date value is there any value so that we get time.
 
pconpcon
You have a couple of options.  If you are just tracking the start time and the end time and you want to have a human readable amount of time between then you could just add two DateTime fields to your object and create a formula that does the datetime math and displays it in a more human readable version.  As for populating those fields you have several options.
  • You could create a visualforce page that records the time into one of those fields and the bounces you back to the record object
  • You could just allow your users to enter the start/end time in the standard edit page of the object
  • You could probably create a Flow [1] that would guide your users through this
  • You could write a trigger to set this field if other criteria (such as task completion) finishes.
I can expand on any of these options if they seem like they are what you want. Or if this is not what you are asking, please feel free to clarify.

[1] http://help.salesforce.com/apex/HTViewHelpDoc?id=vpm_designer_overview.htm
Jason Curtis NBSFDGJason Curtis NBSFDG
Another option is to create a publisher action to update the field, this can work in your Chatter field as well: http://help.salesforce.com/help/pdfs/en/actions_impl_guide.pdf