AX – D365FO – Detect selected line (row) changed in FormGridControl

To detect selected line just use form data sources.

Override active() method of the date source – it’s executed when a user switches to another record. The active record is in the automatic variable with same name as the data source.

Here is an example

public int active()
    int ret;
    ret = super();
    if (ret)
     element.InitActivityTree(AL0VendorActivityAreaView_ds, ActivityTreeAreaView, LogisticsAddressStateAreaView_ds.cursor().RecId); //This is the active record id

    return ret;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s