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, opening a specific form in the new UI

(0) ShareShare
ReportReport
Posted on by 2,485

Hi all,

I have a ribbon button on an entity that when clicked launches a form on a different entity and opens a specific form.  This works fine in the Classic Interface but doesn't seem to honor opening a specific form in the new UI.

In ribbon workbench I have the following:

733567.Capture.PNG

and the JavaScript that is called is as follows:

function OpenSpecificForm(primaryControl)
    {
        const FORMID = "A696976B-EA8A-42F3-B4DC-F35DC9204D58";                      

        var formContext       = primaryControl;
        var parameters        = { formid: FORMID };
        var entityFormOptions = {};
        entityFormOptions["entityName"] = "new_entity_name";

        var recordId = formContext.data.entity.getId();                    
        var recordName   = formContext.getAttribute("new_name").getValue();    

        if (recordId != null)   { parameters["new_targetentityfieldid"] = recordId; }
        if (recordName != null) { parameters["new_targetentityfieldname"] = recordName; }

        Xrm.Navigation.openForm(entityFormOptions, parameters);
    }

Have I missed anything obvious?

Thanks in avdance

*This post is locked for comments

I have the same question (0)
  • BharatPremji Profile Picture
    2,485 on at

    To add to this, the entity form DOES open in the new UI but not to the form I expect.

  • Kevin Grech Profile Picture
    380 on at

    Maybe the parameters are case sensitive. In the documentation it's formId (capital i)

    Link just in case

    docs.microsoft.com/.../openform

  • Verified answer
    BharatPremji Profile Picture
    2,485 on at

    Hi Kevin,

    Thanks for the reply.

    I did think of that when first setting this up and came across this article which suggests that there is a mistake in the Microsoft documentation:

    stackoverflow.com/.../53406004

    The formid needs to go into the formParameters and not in entityFormOptions.

    Bharat

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