Getting the selected row value.

How to get the value of a cell in the selected row in a grid?

Ex: Say i have some customer details in the grid and say i select the 3rd row.I want to retrieve customer account number of the selected row.How can this be done?I want to do this at the form level and not on the datasource level.

Please advice.

The selected row in a tabular form is the current record. You will find it in the Rec variable.

I am not sure how to get that.Could you explain please?

I see you filed this under Axapta, Dynamics Ax - yet this is the Nav Developers forum.