axaptadynamics-ax-2012dynamics-ax-2012-r3

Dynamics Ax How to Add Filter to Grid


I have a form/grid that contain 2 different datasource

I added StringEdit To form StringEdit's EDT is a field From datasource1

I want to add filter to Datasource2 records according to Stringedit

there is relations between tables

select datasource1 Join datasource2 where datasource2.ImpExtraCostInv == datasource1.ImpExtraCostInv && datasource2.ImpDocNum == CostParameter.valueStr()";

qbrType.value(queryValue(datasource1.valuestr())));

Why not working


Solution

  • They can be several things.

    Did you establish a relationship between datasources in datasource properties?

    enter image description here

    You can also do it by code by overwriting init or executeQuery method (depending on what you need is better init method) Did you do it?

    You will need a code similar to this to filter the datasource:

    this.query().dataSourceTable(tableNum("datasource2")).addRange(fieldNum(datasource2,ImpExtraCostInv)).value(queryValue(datasource1.ImpExtraCostInv));