set next action date to friday by default?

A Score Level 1

i want to set the next action date as friday always , suppose today is friday , the action date should be today.

if it is some any other day,the action date should be friday. please tell me how do implement it.

  Discussion posts and replies are publicly visible

Parents
  • Please check with the below code snippet for this calculation.

    load(
    /* To get current Weekday ie Sunday=1,monday=2...*/
    local!weekDay: weekday(
    today()
    ),
    /* To do calculation if its on saturday */
    local!addDays: 6 - local!weekDay,
    /* Then add those days to cuurent Date */
    local!addDays1: if(
    local!addDays < 1,
    - (
    local!addDays
    ) + 5,
    local!addDays
    ),
    /* I f current day is friday it returns same day*/
    if(
    local!weekDay = 6,
    today(),
    today() + local!addDays1
    )
    )

Reply
  • Please check with the below code snippet for this calculation.

    load(
    /* To get current Weekday ie Sunday=1,monday=2...*/
    local!weekDay: weekday(
    today()
    ),
    /* To do calculation if its on saturday */
    local!addDays: 6 - local!weekDay,
    /* Then add those days to cuurent Date */
    local!addDays1: if(
    local!addDays < 1,
    - (
    local!addDays
    ) + 5,
    local!addDays
    ),
    /* I f current day is friday it returns same day*/
    if(
    local!weekDay = 6,
    today(),
    today() + local!addDays1
    )
    )

Children
No Data