Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Xrm.Navigation.openForm() does not open quickCreateForm

Posted on by 55

Hello guys, I have one issue with the Client API reference.

You should be able to open form through client javascript.

But it's not working, has someone came accross the same issue?

I'm calling method openForm from button in the ribbon.

Every variable has the right value, but instead of quickCreateForm, I'll get the main form.
This is my javascript:

function openNewPrefilledKeepingEntityQuickCreate(entityLogicalName, entityId, nameField, friendlyNameField){
    var entityFormOptions = {};
    entityFormOptions["entityName"] = "talxis_o365groupssynckeepingentity";
    entityFormOptions["useQuickCreateForm"] = true;

    if (friendlyNameField === undefined) {
        Xrm.WebApi.retrieveRecord(entityLogicalName, entityId, `?$select=${nameField}`).then(
            function success(result) {
                var formParameters = {};
                formParameters["talxis_name"] = result[nameField];
                formParameters["talxis_targetedrecordurl"] = `?etn=${entityLogicalName}&id=${entityId}`;

                debugger;
                Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
                  function success(result) {
                      console.log(result.message);
                  },
                  function (error) {
                      console.log(error.message);
                  });
            },
            function (error) {
                console.log(error.message);
            }
        );
    }
    else {
        Xrm.WebApi.retrieveRecord(entityLogicalName, entityId, `?$select=${nameField},${friendlyNameField}`).then(
            function success(result) {
                var formParameters = {};
                formParameters["talxis_name"] = result[nameField];
                formParameters["talxis_friendlyname"] = result[friendlyNameField];
                formParameters["talxis_targetedrecordurl"] = `?etn=${entityLogicalName}&id=${entityId}`;
                
                Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
                  function success(result) {
                      console.log(result.message);
                  },
                  function (error) {
                      console.log(error.message);
                  });
            },
            function (error) {
                console.log(error.message);
            }
        );
    }
}


Here is the execution picture:

5710.Capture.PNG

But I'll get the main form. The "Allow quick create" option is checked and the form exists:

5710.Capture.PNG

5710.Capture.PNG

*This post is locked for comments

  • Jan Kostejn Profile Picture
    Jan Kostejn 55 on at
    RE: Xrm.Navigation.openForm() does not open quickCreateForm

    Hi Kokulan,

    I was testing it against the trial instance and including the form in model driven app solved my issue!, thanks a lot.

  • Jan Kostejn Profile Picture
    Jan Kostejn 55 on at
    RE: Xrm.Navigation.openForm() does not open quickCreateForm

    I'll try it one more time with the pictures...

    Here is the execution picture:

    4657.Capture2.PNG

    But I'll get the main form. The "Allow quick create" option is checked and the form exists:

    4657.Capture2.PNG

    458764.Capture.PNG

    I was testing it in Chrome Version 73.0.3683.103 (Official Build) (64-bit)

  • Verified answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Xrm.Navigation.openForm() does not open quickCreateForm

    Hi

    I would first check if you are able to use the Global + button at the top to create record using Quick Create form for the entity.

    Are you doing this from a Model Driven App? If so, have you included your Quick Create form in the app?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans