Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

How to see code from Main_system_library.js

(0) ShareShare
ReportReport
Posted on by 35

Hello,

I have a request to create a new functionality. I needed to check how they are opening the new record when clicking of +new button. 

i tried to search for the webresource that was used in ribbon but i am not able to find it anywhere. Is there any place where i can see the code written in it?

From ribbon i found the name as "Man_system_library.js"

Thanks

  • Suggested answer
    XM-22040801-0 Profile Picture
    XM-22040801-0 11 on at
    RE: How to see code from Main_system_library.js

    If you want to open in a new session to an external web page, you can navigate to a HTML web-resource that embedded an iframe.

    Xrm.Navigation.navigateTo({
        pageType: "webresource",
        webresourceName: ""
    });

    Iframes can have security effects, make sure you understand them before using them.
    See https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
    and https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe

    Example of HTML web-resource:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset='utf-8'>
        <title>Set title here</title>
        <style>
            html, body {
                margin: 0;
                padding: 0;
                width: 100%;
                height: 100%;
                overflow: hidden;
            }

            iframe {
                width: 100%;
                height: 100%;
                border: none;
            }
        </style>
    </head>
    <body>
        <!-- Replace the src attribute with the URL of the page you want to show -->
        <!-- Sandbox attribute is added for security reasons (see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe ) -->
        <!-- See also Content Security Policy: developer.mozilla.org/.../CSP -->
        <iframe src="https://primno.io" sandbox></iframe>
    </body>
    </html>
  • noobCoder Profile Picture
    noobCoder 35 on at
    RE: How to see code from Main_system_library.js

    Hello Xavier Monin ,

    Thanks for this. I need to open an URL. Is it possible using navigateto?

    I cannot use openURL functionality as i want it to open in same window and openurl doesnt provide the open to do so. Or if it does please let me know

    I wanted to open the new url in a new session inside dynamics(Currently CSW has feature to have sessions inside dynamics itself) rather than a new tab in chrome. and i figured that if we open in same window it basically creates a new session

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: How to see code from Main_system_library.js

    Hello,

    You can open the form, hit F12 and look for the code there.

  • XM-22040801-0 Profile Picture
    XM-22040801-0 11 on at
    RE: How to see code from Main_system_library.js

    Hello,

    What do you want to know about opening a new record?

    If you search to open a new record in javascript : Xrm.Navigation.navigateTo() or Xrm.Navigation.openForm()

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans