Refresh Listpage from Child form AX 2012

You often open a dialog or drop dialog when you are working with another form. As a result, you might want to refresh the parent form after you finish the action on the dialog or drop dialog form. However, not every dialog form requires that you update the calling form. Typically, you refresh the parent form when the information that you provide in the dialog form appears on that form.

To refresh a parent form,you must write your code in Child form by Override method CloseOk and write the below code.

public void closeOk()
{
    #Task
    FormRun formRun;
    
    super();
    
    // Get an instance of the calling form.
    formRun = element.args().caller();
    
    // If the caller is a form, refresh that form.
    if(formRun)
    {
        formRun.task(#taskF5);
    }
}