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

I have the same question (0)
  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Suggested answer
    Anas Rafik Profile Picture
    365 on at

    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

  • Shubh_K Profile Picture
    80 on at

    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
    gdas Profile Picture
    50,091 Moderator on at

    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

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    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.

  • Shubh_K Profile Picture
    80 on at

    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.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans