Get selected row values from grid

Good day, I am fairly new to AX and I would like to ask if it is possible to get the value of a selected row in a grid without using the datasource.as the source of values.
Example: I have the rows displayed on the grid and the values from the columns are from different sources(example: Returned Calculated Values, Different Tables, etc.)

No, you can’t do it without a datasource. Datasource is where this information is stored.

But you can read active records from all the datasources.

Thank you for answering sir, How is the second option possible? The one where you can read active records from the data sources. My friend told me that it was possible through the use of elements.

Imagine that your grid displays fields from two data sources, let’s say SalesLine and InventDim.

The form than contains two variables always pointing to the active record of each datasource. Their names are the same as datasource names, i.e. salesLine and inventDim. You can directly access these variables in code and get field values, such as salesLine.ItemId and inventDim.InventLocationId. It’s very easy.

Note that although datasources usually have the same name as tables, it’s not necessary. You may have a datasource SalesInventDim for InventDim table, for instance. Then the variable is salesInventDim, not inventDim.

Thank you for the answer sir, but my problem is that some values that are not easily retrieved from the database because some of them are calculated values that come from a method. I would like to thank you again for answering my questions.

But you can call the method, can’t you?