How can postback the grid ?

Hi

I created form. two controls one is custaccount in dropdown and other is salesorders details in grid.( both are salestable datasource field only)

when i select customer number in combo, then the related sales order details wil display in sales order grid. how to pass the cust account parameters and display the related details. am new to dynamics . developing in AX2009

Thanks in advance

Your high-level steps are:

  1. Filter sales orders by the selected customer account.
  2. Re-execute the query for sales orders.

How exactly you’ll implement it is up to you. For example, you can use this approach:

Create a variable for your query range in classDeclaration:

QueryBuildRange custRange;

After intializing the data source (e.g. in init() below super()), create an instance of the range:

custRange = salesTable_ds.query().dataSource(tableNum(SalesTable))
                .addRange(fieldNum(SalesTable, CustAccount))

Create a method to set the range and rerun the query:

void filterByCustomer(CustAccount _account)
{
    custRange.value(queryValue(_account));
    salesTable_ds.executeQuery();
}

And call it from modified() of your control with customer ID:

element.filterByCustomer(this.text());

You should also think about what should be displayed before a user choose any customer.

Thanks martin.

Its working!!