Refesh Parent form form child form / class

Hi,
Below code is used to refresh the parent form from child form / class.

write this method in parent form

//TO refersh the current form (from child form) and point the cursor for the selected record.
public void refreshForm()
{

    <DataSourceName>_ds.reread();

    <DataSourceName>_ds.refresh();

    <DataSourceName>_ds.rereadReferenceDataSources();

}

write this method in Child form / Class

I wrote the method in close method of the child form to refresh the parent form

public void close()
{
 
   super();

   if (element.args().caller() && element.args().caller().name() == formStr(Alle_SubcontractorPayRegister))
   {
      element.args().caller().refreshForm();
   }

}

I wrote the method in main method of the child class to refresh the parent form

static void main(Args args)
{

    SCWPSCreation wpsCreation;

    ;
 
    wpsCreation = Alle_DLIIntegration_SCWPSCreation::construct();
    wpsCreation.parmSubcontractorPayRegister(args.record());
 
    if (wpsCreation.prompt())
       wpsCreation.run();
 
    if (args.caller() && args.caller().name() == formStr(Alle_SubcontractorPayRegister))
    {
       args.caller().refreshForm();
    }

}
 

 

 

Comments

Post a Comment

Popular posts from this blog

x++ code to Generate cheque for vendor payment journal

Import Procurement Hierarchy / Categories with out code in ax 2012

Copy favorites From one user to another user - Ax 2012