General X++ Development
How do I make a form field editable based on a condition?
How do I make a form field editable based on a condition?
1 answer
Write an answerFor a datasource-bound field, use allowEdit() on the datasource field.
boolean canEdit = salesTable.SalesStatus == SalesStatus::Backorder;
SalesTable_ds
.object(fieldNum(SalesTable, YourField))
.allowEdit(canEdit);I prefer this over only enabling/disabling a single control because it applies to the bound field regardless of which control is displaying it.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer