Method Community

 

Trying to calculate scheduled duration on calendar Edit event

Last post 01-23-2015 9:30 AM by Method_Justin. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-11-2014 5:00 PM

    • mahlonf
    • Top 10 Contributor
    • Joined on 09-28-2012
    • Stevens, PA
    • Posts 879

    Trying to calculate scheduled duration on calendar Edit event

    I have a field in my activity table call SchedDuration. Now that the calendar lets us resize the activity, I need to calculate my schedule duration. I tried doing this and I'm running into a few issues

    I made a copy of the calendar screen...

    First, I tried calculating the date difference using this action.

    This did not save the end date

    so I assigned values to action result to calculate off of these as per the screenshot below

    This works, but I'm getting inconsistent results...

    If an activity is scheduled for 30 minutes, it works just fine. When scheduled for one hour it returns a difference of zero minutes.

    I added some show message actions so you can follow my results.

    Here's my activity displayed at one hour. I change it back to 30 min

    The I stretch it to 60 min and get this. 4PM not sure why the seconds

    Then this...again not sure why the seconds

    Then this...This should be 60. When I stretch it to 30 minutes it displays 30. When I stretch it to 60 minutes it displays 0. When I stretch it to 90 minutes again I get 30. When I stretch it to two hours I get zero.

    Hopefully this will give you enough to troubleshoot it.

    Mahlon L Fisher
    Computer Bookkeeping Solutions
    www.combooksolutions.com
  • 12-15-2014 9:19 AM In reply to

    Re: Trying to calculate scheduled duration on calendar Edit event

    Hi Mahlon,

    I've put a ticket in for the issue with the End Date field not being saved in the Date Difference function.

    For the other issue, it sounds like you'll want to change your Date Difference function to Show result in Total Minutes as opposed to Minutes. Show result in Minutes simply calculates the difference between the mm (hh:mm:ss) column of the time. Show result in Total Minutes will calculate the total amount of minutes that has passed from timeA to timeB, taking the number of hours (or days) into account and formatting the result in minutes.

    Hope this helps.

    - Justin

    Justin Henderiks
    Technical Sales Specialist
    Method Integration Inc.
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400
    Fax: 416.640.6027
    E-mail: j.henderiks@method.me
  • 12-15-2014 12:52 PM In reply to

    • mahlonf
    • Top 10 Contributor
    • Joined on 09-28-2012
    • Stevens, PA
    • Posts 879

    Re: Trying to calculate scheduled duration on calendar Edit event

    Total minutes mostlytook care of my calculation problem. 

    There still seems to be a little issue with the way it's returning the time.

    I have an activity that begins at 10 AM and I drag it to end at 11 AM. the ending time is returned as 11:00:20 AM and Total Minutes returned as: 60.3333333333333.

    I'm sure I can do rounding to control this, but why is it giving me these values?

    Mahlon L Fisher
    Computer Bookkeeping Solutions
    www.combooksolutions.com
  • 01-23-2015 9:30 AM In reply to

    Re: Trying to calculate scheduled duration on calendar Edit event

    Hi Mahlon,

    The issue with the CalendarActivity End Time not saving here has been resolved. Could you try it out and see if you're still having an issue with the returned time?

    - Justin

    Justin Henderiks
    Technical Sales Specialist
    Method Integration Inc.
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400
    Fax: 416.640.6027
    E-mail: j.henderiks@method.me
Page 1 of 1 (4 items)