Skip to Main Content

Synchronize Page Items

When you create a Form region, Apex creates page items for all columns of the table it is based on.
All "not null" columns are automatically set to Validation -> Value Required.
So far so good.

Afterwards, you could set a "not null" item to be displayed as e.g. a Text Field (instead of Display Only), set it to Validation -> NOT Value Required, and make it read-only somehow, e.g. using some JavaScript.
You may want to do this if the column is filled by the database anyway (e.g by an insert trigger), and you don't want to render the item as Display Only (which tends to make it look different from other disabled item types).

As you may have guessed, the (Form) Region -> Synchronize Page Items option could then cause an issue here.
It will reset the item to Validation -> Value Required, which will cause an "ITEM must have some value" error when saving the new row.

If you know which items to look out for (which may be a challenge), a query like this could be useful: Of course the safest option would be to just render the page item as Display Only, and ignore the fact it is a bit ugly :-)

Note that for Interactive Grids, the Synchronize Columns option does a very similar thing for existing columns.
Just as dangerous as the Synchronize Page Items option, but since they both behave in the same way, maybe both are intended to be features and not bugs...