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
Hello kajalp8940,
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.