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

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, you can check this thread

    community.dynamics.com/.../adding-a-form-part---how-to-handle-the-link-to-the-upper-form

  • Menna Allah Ahmed Profile Picture
    163 on at

    Thanks Mohit , It helps me to understand difference between link types

  • Menna Allah Ahmed Profile Picture
    163 on at

    How to refresh form part based on event from main form ?

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Please check this article

    dev.goshoom.net/.../

  • Menna Allah Ahmed Profile Picture
    163 on at

    I do it , It returns the right form but I got an error "object reference not set to an instance of an object" in line of data source , data source returns null

    public void refreshMyFactBox()
    {
    FormRun formrun = this.formRun();
    FormRun factBox = formRun.getFormPartByName(formStr(allocationRatioForm));

    if (factBox)
    {
    FormDataSource allocationds = factBox.dataSource(formDataSourceStr(allocationRatioForm,allocationTable));
    allocationds.refresh();
    allocationds.research(true);
    }
    }

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Your code to read datasource looks fine, Can you try factBox.dataSource().research() in if (factBox) loop and if it doesn't work then please share more info about your solution. Do you have more than one datasource in formPart.

  • Suggested answer
    GirishS Profile Picture
    27,827 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.

  • 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

  • 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 

  • GirishS Profile Picture
    27,827 Moderator on at

    Did you call the setFactBoxesToRefresh method on form run method?

    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

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 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans