here is an example of this.
What you are interested in is the line Key =…
sub onClickViewEdit( oEv as object )
dim aForm as object
dim Key as integer
' get the inovice record
' the user just double clicked on
Key = oEv.Source.Model.Parent.Columns.getByName( "InvoiceID" ).getInt
ItemEntry.setKey(Key, "MSIS/frmItemEntry")
hideMe()
end sub
This grabs the PK from the datasource attached to a grid UI, sets the value in a different form “MSIS/frmItemEntry”, launches that form, then hides the current form.
oEv.Source.Model.Parent gives you the datasource (resultset) the grid is connected to.
The UI control is repsonsible for moving the record pointer in the resultset, your code only needs to read the column value for the current record.
It is not true to say you can’t get this by using the UI controls ‘view’ but that ends up being way more work than is necessary.