Example of what does not work. A column is set to required (actually not the column but the encompassing datacard). The code below is executed via a button without filling the required column.
SubmitForm(form_Edit);
UpdateContext(
{
EditRecord: First(
Filter(
'[dbo].[TestSource]',
TestIndex = _CurTestIndex
)
)
}
);
If(
IsEmpty(
Errors (
'[dbo].[TestSource]',
EditRecord
)
),
Back()
)
The program actually executed the "Back()" function ignoring there is an error. I have tried it with and and without an EditRecord. What does happen on the very first occurence (non on subsequent), the error shows on the page returned to (from back()) (see attached ErrorOnPriorPage.jpg). If you show the submited form again, then you will see the column is highlighted in error that it is required (see ErrorOnFormPage.jpg).
The behavior I want is to stop the page from submitting when there is a required column. Ideally, testing for the error on the page before submitting?