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
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    a!queryFilter(
    field: 'recordType!{95b6b60f-3baf-445b-8ac8-ad1c6aabc820}CMS Cases.fields.{d29ddafb-ab89-4da7-8e24-13e050f348cd}createdOn',
    operator: "between",
    value: {
    datetime(
    year(today() - ri!busniessDaysOpenFilter-1),
    month(today() - ri!busniessDaysOpenFilter - 1),
    day(today() - ri!busniessDaysOpenFilter - 1),

    ),
    datetime(
    year(today() - ri!busniessDaysOpenFilter ),
    month(today() - ri!busniessDaysOpenFilter ),
    day(today() - ri!busniessDaysOpenFilter ),

    )
    },
    applyWhen: a!isNotNullOrEmpty(ri!busniessDaysOpenFilter)

    This is how I have done it now it is working properly except it is taking weekends also. 

Children