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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Page reload issue after using Xrm.Navigation.navigateTo to open a main form.

(1) ShareShare
ReportReport
Posted on by 1,672

Hi,

I am using Xrm.Navigation.navigateTo method to open the main form from the contact form. If I use the save and close button in a modal( please see the image below).

pastedimage1589359803137v1.png

The modal window closes perfectly, but if I refresh the parent page(contact) after this, it reloads to the new record created from the Modal. this issue is not there if I use the close icon in the modal. Has anyone experienced this issue?

following is the js code open the modal.

function loadDialogForm(executionContext) {

    formContext = executionContext.getFormContext();
    var pageInput = {
        pageType: "entityrecord",
        entityName: "nj_dialoguebatchone"    
    };
    var navigationOptions = {
        target: 2,
        height: {value: 70, unit:"%"},
        width: {value: 35, unit:"%"},
        position: 1
    };
    Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
        function success(result) {
                //console.log("Record created with ID: "   result.savedEntityReference[0].id   
                //" Name: "   result.savedEntityReference[0].name)
                // Handle dialog closed
        },
        function error() {
                // Handle errors
        }
    );
    

   

}

Many thanks

nijo

I have the same question (0)
  • Suggested answer
    Johao Larios Profile Picture
    1,795 on at

    Hello there,

    Please try to use openForm function docs.microsoft.com/.../openform

    After try with this please confirm us if you are seeing the same pattern.

    regards,

  • Suggested answer
    Anupam.khasia Profile Picture
    170 on at

    Hi Nijo, 

    We have used XRM.Navigation api but not faced this kind of issue. Alternative you can refresh parent form to reload data. 

    parent.Xrm.Page.data.refresh(true);

    Let me know if that works. Please Mark verified if it works.Thanks

  • Nijos Profile Picture
    1,672 on at

    Hello,

    Thans for teh suggestion, I need to open the foms in a dialog, Xrm.Navigation.openForm method is not supported to open a main form as a dialog.

    Thanks

    Nijo

  • Nijos Profile Picture
    1,672 on at

    Hello Anupam,

    I have tried the reload option and it's not working. If I refresh the page manually using the browser refresh button it is taking me to the record I just created using the modal dialogue.

    I could be some session issue.

    Nijo

  • Ryan S Newcomb Profile Picture
    37 on at

    Remove the result from the success function.

        Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
            function success() {
                    // Run code on success
            },
            function error() {
                    // Handle errors
            }
        );

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans