Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Show Modal dialog in CRM Entity Form.

(0) ShareShare
ReportReport
Posted on by 80

Hi Expert,

I have a requirement to show a modal Dialog on the click of ribbon button on an entity, onclick it should show a dialog where user will select some input from the dropdown and returning selected value and saving with the entity form. earlier it was implemented using window.ShowModalDialog function where I was passing URL of html webresource and showing it on the CRM Form, but its not supported in Chrome. I am looking for the alternate way to achieve this.

Thanks

*This post is locked for comments

  • Shubh_K Profile Picture
    80 on at
    RE: Show Modal dialog in CRM Entity Form.

    Actually I am not allowed to go with window.parent.Xrm.Internal approach but Alert.js I can use. Again facing issue to implement this.

    I am using Alert.showWebResource( ) function, Actual functionality is On the click of Task's ribbon button "Mark Complete" dialog should appear and when user select the appropriate value in the modal dialog it should return it back to the function and that result can we use in further code flow, but here as soon as I click mark complete, Form and this alert popup both are getting close.

    Please suggest.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Show Modal dialog in CRM Entity Form.

    Hi,

    How you are returning the value for   ,

    window.parent.Xrm.Internal.openDialog  return the value in an JS object  and then in the callback get  the object.

    Mscrm.Utilities.setReturnValue(ValueToPass);

    See below reference -

    butenko.pro/.../dynamics-crm-2013-step-by-step-creating-dialog-windows

    Note :Xrm.Internal is deprecated and not documented. So it is your risk to use this function.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Show Modal dialog in CRM Entity Form.

    Hi ,

    If you use older version 2.1 it's free -

    github.com/.../license-v2.1.md

    But new version need license -

    github.com/.../README.md

  • Shubh_K Profile Picture
    80 on at
    RE: Show Modal dialog in CRM Entity Form.

    Thanks Aric,

    Tried Xrm.Internal.openDialog, facing some issues like form is also getting close as soon I click any button on Dialog, value is not returning properly. Trying to fix these issue and One Question is Alert.js is free to use or required licence ?

  • Suggested answer
    Anas Rafik Profile Picture
    365 on at
    RE: Show Modal dialog in CRM Entity Form.

    use this:

    var DialogOption = new Xrm.DialogOptions;
            DialogOption.width = 500;
            DialogOption.height = 620;
    
    window.parent.Xrm.Internal.openDialog("/WebResources/your_web_ressource", DialogOption, null, null, callbackfunction);

    it worked for me

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,188 Moderator on at
    RE: Show Modal dialog in CRM Entity Form.

    Take a look at the following answers:

    community.dynamics.com/.../255599

    This gives you three different approaches:

    Using Xrm.Internal.openDialog (not supported, so it might stop working in the future, but I know that a lot of people use this)

    Using alert.js

    Using openWebResource

    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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans