Notifications
Announcements
No record found.
Hi all,
I got 3 forms one opening another one and i need to find a way to when closing my third form to refresh data displaying on the first one.
I hope my image will be correctly understood.
Regards.
Hi Mack Note,
While calling the FormC from FormB pass the caller form as FormA and add the code to refresh caller DataSource (Here FormA will be caller DataSource) in FormC.
Refer to the below code for refresh caller form datasource.
https://axnotesblog.wordpress.com/2019/03/14/refresh-caller-form-in-d365fo/
https://community.dynamics.com/365/financeandoperations/b/elandaxdynamicsaxupgradesanddevelopment/posts/how-to-refresh-a-calling-form-in-dyn365fo-with-a-simple-code-1533363044
Thanks,
Girish S.
Hi Girish and all,
I didn't understood how to do it
I tried your ways but my formrun datasource got 'null' value.
Could you explain step by step please ?
Can you share your code?
Hi Mack,
Create an event handler on clicked event of 3rd form Close button.
Call the below method on main datasource of FormA.
DS.executeQuery();
DS.research();
These methods help you in refreshing a form which does the same function where we will click refresh button on form.
public void close() { super(); Args args = new Args(formstr(FormA)); FormRun formRun = classFactory.formRunClass(args);
// If the caller is a form, refresh this form if(formRun) { #Task formRun.task(#taskRefresh); } }
I tried this code.
Tell me one thing when you close FormC if it automatically navigates to FormA or you need to write the code in Close method to navigate to FormA?
When i close form C i came back to form A
Automatically
Okay then try the below suggestion.
On the FormB init method get the caller of FormA. Below code will be on FormB.
[Form] public class FormB extends FormRun { FormRun fRun; //override init method of form and get caller form run. public void init() { fRun = element.args().caller(); } //now you need to call the FormC upon closing of FormB //override closeOk method of form. public void closeOk() { Args args; FormRun formRun; super(); //Call the form directly. args = new Args(formStr(rsmMake)); //now pass FormA caller. args.caller(fRun); formRun = new FormRun(args); formRun.init(); formRun.run(); formRun.wait(); } }
Now on the FormC add the below code.
[Form] public class FormC extends FormRun { FormRun fRun; public void init() { fRun = element.args().caller(); // here u will get FormA caller } //now override the closeOk method of form. public void closeOk() { FormDataSource fds = fRun.dataSource("Mention the FormA table name"); now call refresh and research method. fds.refresh(); fds.reread(); fds.research(); } }
If it's still not working debug the code and check.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 611 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader