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 :
Customer experience | Sales, Customer Insights,...
Answered

How we can open form by passing its id

(0) ShareShare
ReportReport
Posted on by 365

I have used the following code to open but its opening select form that was previously selected by the user already

i have to open randomly by passing its id or something else that can open directly the form which I want to open.

Any advice or help would be great.

pastedimage1614087095121v1.png

function checkbox() {
debugger;
var pageInput = {
pageType: "entityrecord",
entityName: "opportunity",
entityId: "9e0d0283-5bf2-e311-945f-6c3be5a8dd64" //replace with actual ID

};
var navigationOptions = {
target: 2,
height: {value: 80, unit:"%"},
width: {value: 70, unit:"%"},
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
// Run code on success
},
function error() {
// Handle errors
}
);
}

I have the same question (0)
  • Verified answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hi,

    I believe that you should use Xrm.Navigation.openForm() instead of Xrm.Navigation.navigateTo(). In face, openForm method will open a form by passing the form Id as parameter.

    Please refer to the code below: 

    var entityFormOptions = {};
    entityFormOptions["entityName"] = "contact";
    entityFormOptions["entityId"] = "E14FA993-FF71-EB11-A812-000D3A374418";
    //Set your form Id
    entityFormOptions["formId"] = "293c878f-f068-40a0-ae48-4297e060871c";
    // Open the form.
    Xrm.Navigation.openForm(entityFormOptions).then(
        function (success) {
            console.log(success);
        },
        function (error) {
            console.log(error);
        });

    Doc: https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/openform

  • unbeatable Profile Picture
    365 on at

    I want to open in New window or popup page can you help me with this?

  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hi, 

    Yes, you can add some parameters: 

    var entityFormOptions = {};
    entityFormOptions["entityName"] = "contact";
    entityFormOptions["entityId"] = "E14FA993-FF71-EB11-A812-000D3A374418";
    //Set your form Id
    entityFormOptions["formId"] = "293c878f-f068-40a0-ae48-4297e060871c";
    entityFormOptions["openInNewWindow"] = true;
    entityFormOptions["width"] = 800;
    entityFormOptions["height"] = 800;
    
    
    // Open the form.
    Xrm.Navigation.openForm(entityFormOptions).then(
        function (success) {
            console.log(success);
        },
        function (error) {
            console.log(error);
        });


  • Go Mo Profile Picture
    5 on at

    Hi,

    I am using same approch (sending FormId through as an parameter) to open a specific form, however Dynamic takes the user  back to the most recent opened form.

    Do you have any idea what can be done to fix it?

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 > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 192 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans