Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

html modal pop up

(0) ShareShare
ReportReport
Posted on by 3
Hi all,
 
I have an html web resource that has some text and I would also like to add a link within the page that will show a modal pop up to another html web resource.  Would anyone be able to assist? Thank you.
  • Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    html modal pop up
    Hi,
     
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
     
  • Suggested answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    html modal pop up
    Hi,
     
    You can implement this with the following code.
    I have an a tag link in the HTML Resource, clicking on this link pops up a window showing the specific HTML Web Resource.
    <body>
        <h1>Test</h1>
        <a id="link" href="#">Click to open the HTML Web Resource window.</a>
    </body>
    <script>
        var a = document.getElementById("link")
        a.addEventListener("click",function(){
        var pageInput = {
            pageType: "webresource",
            webresourceName: "cr77c_test"
        };  
        var navigationOptions = {
            target: 2,
            height: {value: 80, unit:"%"},
            width: {value: 70, unit:"%"},
            position: 1
        };
        window.top.Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
        function success() {
                // Run code on success
        },
        function error() {
                // Handle errors
        }
    );
        })
       
    </script>
     
     
    The relevant API link is referenced below.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans