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

Notifications

Announcements

Community site session details

Community site session details

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

Add relation between form part and main form x++

(0) ShareShare
ReportReport
Posted on by 163

I made a new form , add data source in it and put fields in grid .

after that I added this form as a form part in another form , there are doesn't same table but It has a relation where can I add this relation in form part and show data in grid refer to this loan item ? 

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi Menna, please try to call your method to refresh formPart from executeQuery method of main form's Data source.

    community.dynamics.com/.../317863

  • Menna Allah Ahmed Profile Picture
    163 on at

    I found the error , it can't find datasource because init method of form part doesn't call yet , when I call init in  "setFactBoxesToRefresh" I get another error when I tried to get args.record() in init form part , it returns allocation record not loan item record .

    How can I return loanitem record in args ?

  • GirishS Profile Picture
    27,829 Moderator on at

    Add the factBox buffer in the watch window and see if there is any value for DataSource method. Press F11 to go inside the DataSource method and debug the code.

    Thanks,

    Girish S.

  • Menna Allah Ahmed Profile Picture
    163 on at

    Now I called "setFactBoxesToRefresh" method in run method of the form and "refreshFactBoxes" in active method in form DataSource but It still doesn't work and doesn't go to the condition .

    I made all of this in extension of form and extension of datasource form .

  • GirishS Profile Picture
    27,829 Moderator on at

    "setFactBoxesToRefresh" method must be call in run method of the form.

    "refreshFactBoxes" - you can call it on main form DataSource Write method.

    Thanks,

    Girish S.

  • Menna Allah Ahmed Profile Picture
    163 on at

    I called this method in active() data source in main form (where I want to refresh the form part )

  • GirishS Profile Picture
    27,829 Moderator on at

    Did you call the setFactBoxesToRefresh method on form run method?

    Thanks,

    Girish S.

  • Menna Allah Ahmed Profile Picture
    163 on at

    Hi Girish S , I add methods like PayrollEarningStatement , but it also doesn't work in refresh data source , when I debug it returns the right form part but doesn't see its data source .

    Screenshot-_2800_52_29005F00_LI.jpgScreenshot-_2800_51_29005F00_LI.jpg

    it doesn't go to this condition 

  • Menna Allah Ahmed Profile Picture
    163 on at

    I have one form part in main form and one data source in this part form , I want to refresh data source of form part in main form

    0820.Screenshot-_2800_48_2900_.png7737.Screenshot-_2800_49_2900_.png

  • Suggested answer
    GirishS Profile Picture
    27,829 Moderator on at

    Hi Menna Allah Ahmed,

    You can refer to the standard form PayrollEarningStatement. In the run method they will get all the form part and insert into List - In the separate method they will loop through all the form parts and call the research method.

    Refer to the method setFactBoxesToRefresh - In this method they will get all the form part from FormRun and insert the parts into list variable.

    Refer to the method refreshFactBoxes - This method will loop through all the form part and call the research method of the respective form part. - This refreshFactBoxes method will be called in many places.

    Thanks,

    Girish S.

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

News and Announcements

Season of Giving Solutions is Here!

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
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans