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)

Xrm.Page.ui is null when debugging with F12

(0) ShareShare
ReportReport
Posted on by 422

I try to write some Javascript using the f12 tool. In the console if I write console.log(Xrm.Page) I get 

Æ’ () {
}
if I write Xrm.Page.ui instead I get null. According to this article I should be able to use the console to test javascript : https://msdn.microsoft.com/en-us/library/gg328261.aspx#BKMK_DeveloperTools
I am doing this in the form of a custom entity. Anyone know what I'm doing wrong?

*This post is locked for comments

I have the same question (0)
  • ashlega Profile Picture
    34,477 on at

    Hi,

     have you opened a specific record in Dynamics, or are you looking at the view/dashboard?

    Xrm.Page will only be available on the "forms", not in the views/dashboards/reports/etc

  • anonsgate Profile Picture
    422 on at

    Yes I'm inside the record. I went to the list of that entity, double clicked one entry and now I'm in the form where I can edit the values of my entity like name,owner etc...

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    It seems the "console" does not put you in the right context.

    Try

    document.contentIFrame1.Xrm.Page.ui

    You don't have to do it when using web resources, though.

  • anonsgate Profile Picture
    422 on at

    Thanks it worked!

  • Community Member Profile Picture
    on at

    Spent 2 hours googling, finally got to this thread! Thank you very much! :-)

  • Verified answer
    anonsgate Profile Picture
    422 on at

    If you want a quicker way to test, you can put your "context" at contentIFrame1. In chrome, if you press F12, you will see "top" written in a dropdown. click it and choose contentIFrame1 instead. You can now use Xrm.Page in the console. Note that sometimes it's contentIFrame0

  • Community Member Profile Picture
    on at

    Oh yes, Chrome has better Developer Tools, that makes it so much easier. Thanks

  • Suggested answer
    Community Member Profile Picture
    on at

    [quote user="anonsgate"]

    If you want a quicker way to test, you can put your "context" at contentIFrame1. In chrome, if you press F12, you will see "top" written in a dropdown. click it and choose contentIFrame1 instead. You can now use Xrm.Page in the console. Note that sometimes it's contentIFrame0

    [/quote]

    @anonsgate you are a genius. Thanks! this was great help.

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