Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Dynamic grid and query does not refresh data

$
0
0

DAX Tribe,

I have a need to populate a form grid from a dynamically created query.

I've got the grid and the two columns showing up from BatchJob, but no data ever shows up.

What am I missing?

This is the form method:

private void LoadBatchJobGrid()
{
    BatchJob batchJob;
    Query query = new Query();
    QueryBuildDataSource qbds = query.addDataSource(tableNum(batchJob));
    FormGridControl grid = this.form().design().control('GridBatchJobs');
    FormStringControl ctrlStatus = grid.addControl(FormControlType::String, '1');
    FormStringControl ctrlCaption = grid.addControl(FormControlType::String, '2');

    grid.dataSource(qbds.id());

    ctrlStatus.dataSource(qbds.id());
    ctrlStatus.dataField(fieldnum(BatchJob, Status));
    ctrlStatus.label('Status');
    ctrlStatus.width(100);

    ctrlCaption.dataSource(qbds.id());
    ctrlCaption.dataField(fieldnum(BatchJob, Caption));
    ctrlCaption.label('Caption');
    ctrlCaption.width(200);
}

Which is called here in the Form's Init method.

public void init()
{
    this.LoadBatchJobGrid();
    super();
}

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>