General X++ Development

How do I get a form datasource from a form extension?

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

How do I get a form datasource from a form extension?

SSunny Vasty75 reputation · answered Aug 13, 2026

Get the datasource from the form runtime.

X++
FormDataSource salesTableDs =
    this.dataSource(formDataSourceStr(SalesTable, SalesTable));

The point is to work with the form's actual datasource instance. Creating a new table buffer does not give you the row that is currently active on the form.