Accountability Posted October 3, 2017 Report Share Posted October 3, 2017 I have an employee document submission form. This table has a field called [@field:hours]. Would like to have a virtual field which tells how many cumulative hours for a specific [@employeeID]. Would like the field to auto populate once the submission form is accessed. In other words, as soon as I select the employee from the results page, would like the details page to calculate how many hours this employee has. Thanks for your help. After Re-Reading my explanation. I could have simplified by saying, utilizing JavaScript, how do you sum a column and store the result in a field ? Quote Link to comment Share on other sites More sharing options...
douvega Posted October 5, 2017 Report Share Posted October 5, 2017 Does the hour entries live in the same table or you are trying to sum them from a third table? Quote Link to comment Share on other sites More sharing options...
Accountability Posted October 5, 2017 Author Report Share Posted October 5, 2017 From the same table. Thanks for responding. Quote Link to comment Share on other sites More sharing options...
Mathilda Posted October 6, 2017 Report Share Posted October 6, 2017 12 hours ago, Accountability said: From the same table. Thanks for responding. I would use SQL query in calculated field on details page. E.g.: sum(hours) from table_name where user_id=targer.[@field:userid] Calculated field generates a value on the fly on every page load (therefore it's always up-to-date), but if you need to save it in table you may use solution from this post Quote Link to comment Share on other sites More sharing options...
Accountability Posted October 7, 2017 Author Report Share Posted October 7, 2017 Thank You Mathilda. I will give it a try. Thanks again for helping. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.