General X++ Development

How do I refresh a form datasource after updating a record in X++?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I refresh a form datasource after updating a record in X++?

SSunny Vasty75 reputation · answered Aug 13, 2026

Usually, if you updated the current record and want the form to show the database value again:

X++
myTable.update();

MyTable_ds.reread();
MyTable_ds.refresh();

If the actual result set needs to be rerun:

X++
MyTable_ds.research(true);

Do not automatically call refresh(), reread(), research(), and executeQuery() together. Use the one that matches what changed.