We have a field in our Opportunity entity that is a calculated value. This field stores the time an Opportunity has been sitting at a particular stage. The Stage duration is calculated as the number of minutes since the opportunity was set to the current stage value. The result of the calculation is stored in the database as a value in minutes. 

The interface currently has some code to determine whether to display the number of minutes as minutes, hours or days. 

The logic make a decision based on the result of a calculation and also the number of decimal places resulting from the calculation.
I have been advised that the current logic is as follows:
Get the value in minutes, and convert it to hours, and days.

If below criteria met, display the value in days

Minutes number >= 1440, and its days values has 2 digit

If below criteria met, display the value in hours

Minutes number >= 60, and its hours values has 2 digit

Otherwise, display the value in minutes.

I believe the logic should be much simpler as follows: 
If the time frame is less than 60 minutes � Display in minutes


If the time frame is greater than or equal to 60 minutes and less than 1440 minutes � Display in Hours


Display in Days




Category: Lead Management
Needs Votes