General X++ Development
How do I refresh a datasource from an edit method?
How do I refresh a datasource from an edit method?
1 answer
Write an answerIf this is a form edit method, update the value and refresh only what you actually need.
public edit str myEditMethod(boolean _set, str _value)
{
if (_set)
{
// Save/update the value.
MyTable_ds.reread();
MyTable_ds.refresh();
}
return currentValue;
}Be careful with executeQuery() inside an edit method. Rerunning the whole datasource can move the active record or make the UI feel strange.
If the edit method is on a table, it should not try to reach into a form datasource. Keep UI refresh logic on the form.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer