Saturday, November 5, 2011

Refresh Caller form From another/child form in dynamics ax 2009

It is quite straight forward.  In the parent form, write a method like below -
void bookrefresh()
{
    <form datasource>.reread();
    <form datasource>.refresh();
   <form datasource>.research(true); // This is used to be on the same record.
}
In the child form, you can do this -
void bookRefresh()
{
    FormRun callerForm = element.args().caller();

    if (callerForm)
    {
        if (callerForm.name() == formstr(<form name>))
        {
            callerForm.bookRefresh();
        }
    }
}

1 comment: