I really appreciate the help of Paula Selvidge and the example she prepared.
This is how the result of working time calculation looks like in PerfectForms:
Paula commented on the results of implementation methods of Filter weekends and Filter holidays when calculating total available time.
Filter Weekends
"I have employed two ways to address weekends in this application. The first way is via the function Date Difference in the Formula Editor using this function one chooses the start and finish date. Then they choose the unit value (h for hours, m for minutes, d for days). If you type in "wd" (weekdays) for the value you will filter out weekends from the day count."
"The second way used a Simple Branch behavior that checked if the word "Saturday" or "Sunday" matched the date being examined. I used the Weekday Name function in the Formula Editor to return the name of the date being examined and I simply checked to see if it was on a Saturday or Sunday."
Filter Holidays
"Since observed holidays vary from country to country and business to business I decided to manually create lists of the holidays that would be checked during the form operation. Like the weekend solution, I have employed two ways to resolve the problem.The first solution uses a Multiline Text Input box with the holiday dates to check. This field is hidden on the form."
"The second solution that I also employed was specific to the working time calculation. Where we set the beginning and end date for a project and get the workable hours. In this solution, I created hidden date fields with the holiday dates inserted."
"Next the form would check if any of these values existed within the dates selected. When it checks for Christmas it would look like this:"
"Checking if the date I labeled as Christmas was within or on the dates entered."
This is how form customization looks in PerfectForms:
This is the algorithm (Behavior as they call it in PerfectForms) of what happens by pressing "Until Completion" button to calculate Working Days and Hours of Work:
And by pressing "End Date" button to calculate Days of Completion we have the following algorithm:
Conclusions:
As you can see Behaviors are just another way of programming through flow charts. To be honest I am not a fan of such a method for I think this way is more cumbersome if compare it with a text method. Besides, it’s more difficult to see complete app logic picture as each particular behavior distorts it. On the other hand "behavior" provides users with some flexibility so you can program business logic and calculations of the form.
No comments:
Post a Comment