title: How to access controls from a console
body: <p>I tried to execute the following command from the console.</p>
  
  <pre><code>var subject = Xrm.Page.ui.controls.get("subject");
  </code></pre>
  
  <p>That's the exact syntax I'm using in the web resource that I'm plugging in to CRM. However, I only got an error message saying that "unable to get property 'controls' of undefined or null reference".</p>
  
  <p>I do understand the message. What I want to know is two-fold.</p>
  
  <ol>
  <li>What syntax will work from the console (<kbd>F12</kbd>) to refer to the stuff on the screen?</li>
  <li>Why doesn't it work the way I did? Where doesn <em>ui</em> come from?</li>
  </ol>
  
  <p>I've checked that I can refer to both <em>Xrm</em> and <em>Crm.Page</em> but apparently <em>ui</em> is <em>null</em> (it's listed when I print out the contents of <em>Page</em> but sett to <em>null</em>).</p>