Forum Discussion
JessicaHaskins
7 years agoQrew Cadet
So I added a code page named duration.js and copied in the above code you commented. Would I only need to change the _fid_ ? Would I need to change anything else? Or would I just insert the code into my existing code page for the timer?
I changed my duration field to this, but the duration field on the table doesn't have anything in its column:
I changed my duration field to this, but the duration field on the table doesn't have anything in its column:
_anomDiebolt_
7 years agoQrew Elite
My example did not use a formula field [Duration] = Seconds([Last Saved Time]).
If you choose to use and display such a field it will only hold a valid value when the timer is stopped,
My script set the [Last Saved Time] through the API when the timer was stopped and your [Duration] field will react to this change. However, you don't want to create a situation where a displayed value is different than the stored value. So all you have to do is reload the page when the timer is stopped and when the page refreshes the stored value of [Duration] will once again be in sync with the displayed value of [Duration]
This is a generic concern. If you are using the API to change a field's value you never want to get into a situation where the displayed value is different than the stored value or it will cause confusion to your users,
If you choose to use and display such a field it will only hold a valid value when the timer is stopped,
My script set the [Last Saved Time] through the API when the timer was stopped and your [Duration] field will react to this change. However, you don't want to create a situation where a displayed value is different than the stored value. So all you have to do is reload the page when the timer is stopped and when the page refreshes the stored value of [Duration] will once again be in sync with the displayed value of [Duration]
This is a generic concern. If you are using the API to change a field's value you never want to get into a situation where the displayed value is different than the stored value or it will cause confusion to your users,