Ai
Sets a date and validates that the control does not enter an error state.
Playwright Page (or compatible subset).
The ID of the DatePicker control.
The date to set.
Optional
Optional date operation settings.
ui5.date.setAndValidate
Set a date and verify the control does not show a validation error.
On success, the date is set and the control's valueState is not 'Error'.
Combines setDatePickerValue() with a valueState check. Throws if the date is outside the allowed range (minDate/maxDate) or format is invalid.
sap.m.DatePicker — setValue(), getValueState()
Safely set dates with validation in SAP forms (e.g., fiscal period constraints).
ControlError if the control enters an error value state after setting.
await setAndValidateDate(page, 'datePicker1', '2024-01-15'); Copy
await setAndValidateDate(page, 'datePicker1', '2024-01-15');
Sets a date and validates that the control does not enter an error state.