how to get a record from active tab page.

i have a form with 4 tab pages ,

on first tab i am displaying employee details with grid

and on 4th tabpage i am displaying his monthly attendance details in grid.

and 4th tabpage i added a menuitem button which launches a new form(attendance update)

with details of active record on that tabpage

here i am getting the problem the form is not loading with active record that i have selected.

can you help how to write the init() method for this newform(attendance update).

or is there any other method to get selected record on active tabpage

thak u

on the button properties set datasource from the table which you want the record.

on init you can get the record with element.args().record()

Hi Ram Babu,

If the form is based on Employee record then the attendence update subform will update automatically (Provided you have defined the SubFormLink property).

If the Form is not based on employee record and the grid on the 1st tab is itself a subform then you will have to write code.

OnActivate of the Attendance Subform, you will have to call a function on the Employee subform that returns the currently selected employee record.