web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to refresh data on the form level with X++?

(2) ShareShare
ReportReport
Posted on by
Hello, I have a form and a dialog in D365FO that when I click the Ok button, it modifies the data.
My only problem is when the dialog is closed, the data on the form level is not refreshed until I click the refresh button above the form.
How can I write this in my code.
 
I tried the datasource.refresh() and reread() but nothing worked.
 
Can someone help?
 
I have the same question (0)
  • Layan Jwei Profile Picture
    8,112 Super User 2025 Season 2 on at
    Hi,
     
    Did you try to call together "reread then refresh"?
     
    Or try to call research(true); alone
     
    Thanks,
    Layan Jweihan 
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Roy Saliba Profile Picture
    on at
    Yes I tried but nothing worked
  • Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,
     
    Can you share your code? Did you get caller DataSource?
     
    Also try to use the following:
    YourCallerds.reread();
    YourCallerds.rereadreferencedatasource();
    YourCallerds.research(true);
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Mohamed Amine Mahmoudi Profile Picture
    26,398 Super User 2025 Season 2 on at
    Hi @Roy
     
    I hope this can help you and give you some hints.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Layan Jwei Profile Picture
    8,112 Super User 2025 Season 2 on at
    Hi Roy,
     
    I think it should work if you did this for the caller datasouece. Please share ur code with us.
  • Anthony Blake Profile Picture
    2,963 Super User 2025 Season 2 on at
    I think you must be calling it from the wrong place/method/event handler, because the code below looks okay. Share your code & debug results.
  • Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • Suggested answer
    Nasheet Ahmed Siddiqui Profile Picture
    2 on at
     
    Just get the parent data source in the init of the form.
    ParentDataSource = element.args().record().dataSource();
     
    call the below in the close of the form to get the refresh of the parent datasource.
     ParentDataSource .research();
     ParentDataSource .refresh();
     
     
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    After the update logic in the dialog code, you need to get the caller datasource and call research(true).

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans