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

Announcements

No record found.

News and Announcements icon
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

I have the same question (0)
  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    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?

  • Suggested answer
    Seren S Profile Picture
    402 on at

    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.

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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
    Indra Sheker Profile Picture
    69 on at

    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

  • Indra Sheker Profile Picture
    69 on at

    Thanks mate didn't observe.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans