Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Javascript in webresources in Dynamics 365 Portals

Posted on by 225

In portals I've created a web form with three steps where the third should be an iframe with some input boxes. We do it like this because its more dynamic and we can leave it up to the entity to load a template of questions for the user to answer. 

It works well in Dynamics 365.

But now I've started building a portal for the Dynamics instance and working with web forms. I can load the forms already defined in Dynamics bt when I try to call the XRM like i do when I want to do some stuff with javascript in the background it states that "Xrm is undefined".

    <script>
    
    var Xrm = window.parent.Xrm;
    var enity = Xrm.Page.data.entity;

    var name = Xrm.Page.getAttribute("msdyn_name").getValue();

    console.log('msdyn_name = ' + name)
    
    </script>


So, is there a way to access XRM for fetching attributes, do queries and stuff like I'm used to with web resources inside Dynamics?

Categories:

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans