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
}
);
}

  • Go Mo Profile Picture
    Go Mo 5 on at
    RE: How we can open form by passing its id

    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?

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,212 User Group Leader on at
    RE: How we can open form by passing its id

    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);
        });


  • unbeatable Profile Picture
    unbeatable 365 on at
    RE: How we can open form by passing its id

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

  • Verified answer
    meelamri Profile Picture
    meelamri 13,212 User Group Leader on at
    RE: How we can open form by passing its id

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans