Wednesday, August 22, 2007

Accessing Parent Datasource

If you need access to the datasource() of the parent form. Parent form and child form being attached with dyna links you can use the following code snippet

element.args().record() to get the Datasource selected on the parent form.

For e.g. If you create a form named CustAdditions which is a child form to CustTable, and these two datasources are attached using dyna links and you want the selected CustTable record on child form you can write in the init method of CustAdditions

Code Snippet:
public void init()
{
CustTable custTable = element.args().record();
}

4 comments: