Interface Definition: Expression evaluation error at function 'calworkdays' [line 83]: A null parameter has been passed as parameter 1.

Certified Senior Developer

a!dateField(
label: "Return To Office Date",
labelPosition: if(ri!readOnly, "ADJACENT", "ABOVE"),
value: ri!NIC_LeaveSummary.returntoofficedate,
saveInto: ri!NIC_LeaveSummary.returntoofficedate,
readOnly: ri!isLeaveApplied,
validations: {
if(calworkdays(ri!NIC_LeaveSummary.leavestartdate,ri!NIC_LeaveSummary.returntoofficedate)- 1 >5,"You can apply max 5 days leaves",{}),
if(
a!isNotNullOrEmpty(ri!NIC_LeaveSummary.leavestartdate),
if(
calisworkday(ri!NIC_LeaveSummary.leavestartdate),
{},
"Please select weekdays. Weekends are not allowed"
),
{}
),
if(
a!isNullOrEmpty(ri!NIC_LeaveSummary.leavestartdate),
"Please select leave start date",
{}
),
if(
ri!NIC_LeaveSummary.leavestartdate > ri!NIC_LeaveSummary.returntoofficedate,
" Please select return to office date later than leave start date",
{}
),
}
),

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hello ,

    Is this error when you have not yet interacted with the fields?

    If yes then it is because you are passing null values to evaluate the calworkdays function. You will have to do a null check and then do the validations. You will have to write a condition in such a way that if the values are empty, it does not validate. only when your values that are being evaluated are not null the validation ,ust be done.

Reply
  • 0
    Certified Senior Developer

    Hello ,

    Is this error when you have not yet interacted with the fields?

    If yes then it is because you are passing null values to evaluate the calworkdays function. You will have to do a null check and then do the validations. You will have to write a condition in such a way that if the values are empty, it does not validate. only when your values that are being evaluated are not null the validation ,ust be done.

Children
No Data