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

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans