- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2023 06:20 AM
I have a requirement for reporting purpose on a custom table. Need to calculate only the no of days the request is in a particular state.
If the request changes from state 1 to capture the no of days the request is in state 1
If the request changes from state 2 need to capture the no of days the request is in state 2
if the user changes the state from state 2 to state 1 vice versa , duration days should append to the existing
New to coding. Appreciate if someone helps with the code.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2023 11:34 PM
Hi @SAS21 ,
Why would you utilize code and not metrics which is in general the purpose of your requirement?
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2023 06:43 AM
Follow this approach
Step 1: Create 2 fields >> 1 to store timestamp of Previous state change (Default value > opened date)
>>2 one to capture State||Days from onChange
Step2: onChange Client script on State
>> Calculate the days between 1st field and current date
>>Set 1st field value current timestamp
>> Set and append 2 field value as current state|:days
Iterate Step2
However field2 will show as State1:2days ,State2:3days
***Hit answered and helpful if this helped to solve your question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2023 11:34 PM
Hi @SAS21 ,
Why would you utilize code and not metrics which is in general the purpose of your requirement?
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/