Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Setting Default Main Form does not work

(0) ShareShare
ReportReport
Posted on by

It seems that I am not able to set the Main Form for an entity in my Model Driven App,

So I have two entities

 

Entity1 and Entity2

 

Entity1 contains a lookup for Entity2 and there is a 1 to N relationship between the two.

 

For Entity2 I have two main forms:

 

  1. Information: Is (should be) the default one and is used to crate or edit the Entity2 records.
  2. History: Is a form containing a subgrid of related Entity1 records.

 

When in the Entity1 form I have a button that should be able to call the second Entity2  form using

 Xrm.Navigation.openForm({
                    entityName: "Entity2",
                    entityId: Entity2_ID,
                    formId: formID
                }, parameters);
            

This seems to be working, however when I access the Entity2 from the SItemap and try to access the main form, I always get the second form.

I tried to ensure the forms are in the correct order from Entity -> Forms -> Forms Order and indeed, the first one is the Information form.  I even tried removing the Form from the list of forms in the App Designer and I am still getting the History form as default when working on the app.

tried opening new browsers to exclude session issues.

what is going on?

  • Community Member Profile Picture
    on at
    RE: Setting Default Main Form does not work

    Hi MarkDeg,

    I'm glad your problem has been solved, the original default form may have flow or plug-in, which result in it.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Setting Default Main Form does not work

    Thanks for your reply. As i mentioned, my issue was not caching or session related as I had already tried opening a new browser.

    However manged to get it to work, simply by creating a new main default form, and now it is working as expected!

    i guess the default main form was somehow not working properly. no idea why, but glad i found it.

    thanks again

    Mark

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Setting Default Main Form does not work

    Hi MarkDeg,

    I have try to set form order and add following Js code to the form, and it open history form (not default form) successfully.

    Then I access entity from site map, it open Information form(default).

    pastedimage1598516921686v2.png

    function testopenform()
    {
    var entityFormOptions = {};
    entityFormOptions["entityName"] = "new_aidefault";
    entityFormOptions["formId"] = "c7e00672-70c1-4a2d-a940-02d387ee0f56";
    entityFormOptions["entityId"] = "0b06bbd5-06dd-ea11-a813-000d3a56957f";
     
    // Open the form.
    Xrm.Navigation.openForm(entityFormOptions).then(
        function (success) {
            console.log(success);
        },
        function (error) {
            console.log(error);
        });
    }

    As you mentioned, you can access history from when you have deleted it, it seems a caching issue, Clear the cache of the browser or use private mode in browser.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 106

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

Overall leaderboard

Product updates

Dynamics 365 release plans