Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Xrm.Navigation.openForm() doesn't work for existing record ?

(0) ShareShare
ReportReport
Posted on by 69

Hello All,


I am working with V9.1 where I observed that Xrm.Navigation.openForm() is not working for an existing record instead I used the deprecated way Xrm.Utility.openEntityForm() then it works as expected.

It is opening the record but all the fields are blank, so I tried the deprecated way then it works. 

var entityFormOptions = {};
entityFormOptions["openInNewWindow"] = true;
entityFormOptions["entityName"] = myEntity;
entityFormOptions["entityId "] = myEntityGuid;
Xrm.Navigation.openForm(entityFormOptions);

Any suggestions?

Thanks,

Indrasheker

*This post is locked for comments

  • Indra Sheker Profile Picture
    69 on at
    RE: Xrm.Navigation.openForm() doesn't work for existing record ?

    Thanks mate didn't observe.

  • Suggested answer
    Indra Sheker Profile Picture
    69 on at
    RE: Xrm.Navigation.openForm() doesn't work for existing record ?

    Hi Rawish,

    I have tried using successCallBack too but no luck. Also please see the below attached the response from sucessCallBack(id is undefined).

    376862.Capture.PNG

    Thanks,

    Indrasheker

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Xrm.Navigation.openForm() doesn't work for existing record ?

    Hi,

    You have space in your entityId parameter. So CRM must be opening a new form instead of an existing form. Try this-

    ==========

    var entityFormOptions = {};

    entityFormOptions["openInNewWindow"] = true;

    entityFormOptions["entityName"] = myEntity;

    entityFormOptions["entityId"] = myEntityGuid;

    // Open the form.

    Xrm.Navigation.openForm(entityFormOptions).then(

       function (success) {

           console.log(success);

       },

       function (error) {

           console.log(error);

       });

    ===========

    Hope this helps.

  • Suggested answer
    Seren S Profile Picture
    402 on at
    RE: Xrm.Navigation.openForm() doesn't work for existing record ?

    Hi Indra,

    Do you have your return functions at the end of calling .openForm() function.

    function OpenNewEntityForm() {
        var entityFormOptions = {};
        entityFormOptions["entityName"] = "contact";
        entityFormOptions["openInNewWindow"] = true;
    
        // Set default values for the Contact form
        var formParameters = {};
        formParameters["firstname"] = "SEREN";
        formParameters["lastname"] = "SERIFOGLU";
        formParameters["fullname"] = "SEREN SERIFOGLU";
        formParameters["emailaddress1"] = "seren.serifoglu@live.com";
    
        // Open the form.
        Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
            function (success) {
                console.log(success);
            },
            function (error) {
                console.log(error);
            });
    }


    This totally works on with Version 1710 (9.1.0.1658) online / v9.1

    You can try with above sample code. If you need further information about parameters;

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-navigation/openform

    Hope it helps.

    Cheers, Seren.

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: Xrm.Navigation.openForm() doesn't work for existing record ?

    Hi Indrashekar,

    the code looks fine and should work as suggested here : docs.microsoft.com/.../openform

    the only difference is you are not using a successCallBack function but i believe is option and wont really create issues.

    I would recommend you try to debug the script and see if you have anything in the console?

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 > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans