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 :
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

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

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans