SBX - Search With Button

SBX - Forum Post Title

Force Form Datasource to load all records

Microsoft Dynamics AX Forum

NoobDaxCoder asked a question on 14 Jun 2019 4:03 AM

Question Status

Unanswered

The custom table  has about 50 records.  When the form is opened, number of loaded record is 50. After a call to the execute query to same datasource, the number of loaded records gets reduced 24. I need all records in the cache. So i can display in the grid.

Reply

Hi NoobDaxCoder,

What is your exact question here?

Reply
NoobDaxCoder responded on 17 Jun 2019 4:32 AM

1:Custom form and Custom DS/ Custom Tmp DS which gets data from CustdomDS via code. CustomTmpDS displays data in a grid. With just over 50 records for testing purpose. In future there could 100's of the thousands of records.

2: i update customDS.field from draft to activated. Once that operation is complete, i need the activated status displayed in the grid. i re-execute the code to population customtmpds.

3: problem arises, when i do execute query for customDS. originally it holds 50 records in record cache, after call to execute query only 24 record is there.

4: So populated record in Customtmpds does not have all the records as desired and in desired state that is transfered.

How to force custom DS to load all records. instead of just 24.

I referred the link, and yes customDS.findrecord(customDS:find(customds.primarykey)); does fix the problem for me. However i dont want to use find() or findrecord() call here. as the form contains very large volume of data.

Is there any workaround here?

community.dynamics.com/.../188228

Reply

What do you mean with the cache?

Are you sure there are still 50 records in the table instead of 24?

Reply

SBX - Two Col Forum

SBX - Migrated JS