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)

HTML dialog box in Dynamics 365 Mobile Application

(0) ShareShare
ReportReport
Posted on by

Is it possible to open the HTML dialog box (i.e.  $ ("div>") .html (html content). dialog ({})) in mobile application? Reason being, I have one functionality which is working fine in web application, but when it comes to mobile application it is not working. I am quite sure that the Dynamics 365 process dialog doesn't work on mobile application and tablet but not sure about HTML dialogs.

Suggestions would be appreciable

Thanks & regards,

Shashank Vishwakarma

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gupta.ambar2009@gmail.com Profile Picture
    797 on at

    if its in CRM ,you can try with Xrm.Utility.openEntityForm

  • Suggested answer
    Seren S Profile Picture
    402 on at

    Hi Shashank,

    I think you cannot open a dialog box in mobile environment but you can use a modal. I assume that you have a web resource which runs in mobile/tablet and here is the deal.

        <!-- Trigger/Open The Modal -->
        <button id="myBtn">Open Modal</button>
    
        <!-- The Modal -->
        <div id="myModal" class="modal">
            <!-- Modal content -->
            <div class="modal-content">
                <span class="close">&times;</span>
                <p>Some text in the Modal..</p>
            </div>
        </div>

    After inserting modal container you can able to call.

            var modal = document.getElementById('myModal');
    
            // Get the button that opens the modal
            var btn = document.getElementById("myBtn");
    
            // Get the <span> element that closes the modal
            var span = document.getElementsByClassName("close")[0];
    
            // When the user clicks the button, open the modal
            btn.onclick = function () {
                modal.style.display = "block";
            }
    
            // When the user clicks on <span> (x), close the modal
            span.onclick = function () {
                modal.style.display = "none";
            }
    
            // When the user clicks anywhere outside of the modal, close it
            window.onclick = function (event) {
                if (event.target == modal) {
                    modal.style.display = "none";
                }
            }


    And some styling for better looking.

        <style>
            body {
                font-family: Arial, Helvetica, sans-serif;
            }
    
            /* The Modal (background) */
            .modal {
                display: none; /* Hidden by default */
                position: fixed; /* Stay in place */
                z-index: 1; /* Sit on top */
                padding-top: 100px; /* Location of the box */
                left: 0;
                top: 0;
                width: 100%; /* Full width */
                height: 100%; /* Full height */
                overflow: auto; /* Enable scroll if needed */
                background-color: rgb(0,0,0); /* Fallback color */
                background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
            }
    
            /* Modal Content */
            .modal-content {
                background-color: #fefefe;
                margin: auto;
                padding: 20px;
                border: 1px solid #888;
                width: 80%;
            }
    
            /* The Close Button */
            .close {
                color: #aaaaaa;
                float: right;
                font-size: 28px;
                font-weight: bold;
            }
    
                .close:hover,
                .close:focus {
                    color: #000;
                    text-decoration: none;
                    cursor: pointer;
                }
        </style>


    Here is the result on tablet view.

    1004.ss.jpg

    I hope it will give you an idea to play.

    Cheers, Seren.

  • Community Member Profile Picture
    on at

    Hi Seren,

    Thanks for the suggestion in such a discriptive way. :)

    I can't use the additional section to call model popup. I need to call the model dialog as a popup on click of ribbon button. as the functionality is already working on web browser.

    Kindly ignore the black spots for security reasons. The attached screenshot is taken from web browser(functionality is working fine), but the same functionality is not working mobile application.

    8311.screenshot.png

    Is there any alernative way to get this task done.

    Thanks & regards,

    Shashank

  • Suggested answer
    Seren S Profile Picture
    402 on at

    Hi Shashank,

    Your screenshot is not available but I don't think that you can open HTML Dialog on mobile and tablet applications. This is against the flat structure of mobile and maybe this is the reason why Microsoft also is not preferring to enable User Dialogs in mobile :)

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