How to use calWorkDays with a!customFieldDateDiff function

Certified Associate Developer

I want to calculate number of working days between two dates (record field) and use the output as a custom field in the record. Getting stuck while trying to use calworkDays in a!customFieldDateDiff function. Can anyone please help

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    Hi Stefan,

    Any suggestions on how this could be achieved? Due date calculation is different scenario which will not wok here.

    We cannot store business days open field also while writing the data as well because it is a runtime function. 

    calworkdays func works but only for displaying open days in grid column , how to apply business day search filter on top of that grid list ?

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Got it Stefan but for us Due date would be today's date or the date when the filter is being applied...So is it possible to store the current data in record as a field which would keep updating itself.

  • 0
    Certified Lead Developer
    in reply to parikshitd0001

    This is so confusing !!! I have a hard time understanding all this logic. When I work on cases, I care about the one that is open for the longest time. Filtering for a case that is exactly open since 4 days, seems weird to me. But that is just my personal opinion.

    So, can't you just not do any calculations, but adjust the filter value in a way it includes non-working time? So, on a Monday, I want to see cases that are open for more than 4 days. This means that I actually have to filter for > 6 days, right? Using a!subtractDateTime, I get exactly that date.

    So I transfer the calculation from DB into the filter attribute.

    This would make sense in the way I understand your explanations. But I might be completely wrong.