How to know what record I am in? Dynamics AX7

108 views Asked by At

Here is the scenario:

In the Sales and marketing > Sales orders > All sales orders
I entered the lines by double-clicking the Sales order number
by doing that I am entering the lines of the sales order.

Now in my lines, there is a button there where I will use to add a syntax where I will insert fields in my newly created table.

I would like to know how can I know what record I am in (before entering the lines/before double-clicking the sales order number). I need to know what Sales order number I'm in as I enter the lines of the record.

2

There are 2 answers

1
Matej On

Every record is extended from [Common]. There you have field TableId. You can get table name with [tableId2name].

You can inspect fields with DictTable and field* methods.

0
Il Vic On

In every form the current record of a specific FormDataSource has the same name of the FormDataSource. For example in the SalesTableListPage form the only datasource is called "SalesTable", so the current sales order record is identified in your code with the salesTable identifier.