Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

html modal pop up

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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,556 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,625 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans