Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Open Entity Forms From JavaScript

(0) ShareShare
ReportReport
Posted on by 60

Open  Entity Forms From JavaScript 

i want to open project entity from when i create new record of Opportunity from Quick create from 

*This post is locked for comments

  • Suggested answer
    RE: Open Entity Forms From JavaScript

    Xrm.Utility.openEntityForm("entityName",results["RecordID"]);

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Open Entity Forms From JavaScript

    Thanks Shahbaaz. It's work for me.

  • Verified answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,205 on at
    RE: Open Entity Forms From JavaScript

    Hi Pradeep,

    Use below code,

    function createProject()

    {

    if (confirm('Are you sure you want to save')) {

    var parameters = {};

    parameters["msdyn_description"] = "test"

    Xrm.Page.data.setFormDirty(false);// this will make your form dirty to false and

                     //you wont get alert message

    Xrm.Utility.openEntityForm("msdyn_project" , null , parameters);

    }

    }

    If it resolved your issue, please mark my answer verified.

    Thanks,

    Shahbaaz

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Open Entity Forms From JavaScript

    Hi Pradeep,

    You have added the code to show an alert "Click Yes or cancel".

    You can just use the code to open the entity form i.e.

    ===============

    function Form_onsave() {  

     var name = Xrm.Page.getAttribute('name').getValue();

                //Xrm.Utility.openEntityForm("msdyn_project");

                  var parameters = {};

                 parameters["msdyn_description"] = name;

                 Xrm.Utility.openEntityForm("msdyn_project", null, parameters);

    }

    ===============

    Hope this helps

  • RE: Open Entity Forms From JavaScript

    Hi Ravi,

    Thanks for the quick response, the code is working but the issue is when it redirect to project record, it gives alert message that i dont want, other than that my code is working fine.

    below is the function i am using.

    function Form_onsave() {  

     Xrm.Utility.confirmDialog("Click Yes or cancel",

           function() {      

                 var name = Xrm.Page.getAttribute('name').getValue();

                 //Xrm.Utility.openEntityForm("msdyn_project");

                   var parameters = {};

                  parameters["msdyn_description"] = name;

                  Xrm.Utility.openEntityForm("msdyn_project", null, parameters);

           });

    }

    Thanks,

    Pradeep

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Open Entity Forms From JavaScript

    Hi Pradeep,

    Xrm.Utility.openEntityForm is the supported JS method to open entity form. Take a look at this document-

    msdn.microsoft.com/.../jj602956.aspx

    Hope this helps.

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans