Adding Duration

haylingstandrewshaylingstandrews Member Posts: 4
I have written a report that shows the duration taken to complete a customer support call but i am having trouble trying to total the duration i.e. 1st line = 15mins, 2nd line = 45 mins so total = 1hr

I have created a variable called Total Time and then written some code to say:-

TotalTime := Actual Time Taken + Actual Time Taken

The result i get is 1hr 30min so it seems this adding the time from the last line to itself.

I am a Novice when it comes to C/AL code and any help would be greatly appreciated.

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Duration is a special fieldtype in navision and can be the result from calulations with datetime fields.

    This makes calculating with time much more easy than with time fields.
  • lubostlubost Member Posts: 628
    Your formula should be:

    TotalTime := TotalTime + Actual Time Taken;

    this formula should be placed in OnAfterGetRecord trigger.
Sign In or Register to comment.