title: Accessing SugarCRM Global variable $current_user from a custom Javascript file v6.5
body: <p>How can I access global SugarCRM variables from a custom javascript file that I have attached to a field on the <code>DetailView</code> in SugarCRM V6.5. </p>
  
  <p>Specifically, I want to access the <code>$current_user</code> global PHP variable from the Javascript file.</p>
  
  <p>I have added the javascript file by editing the <code>custom/modules/Accounts/views/detailviewdef.php</code> and then editing the array to look like this</p>
  
  <pre><code>array (        0 =&gt; 
      array (
        'file' =&gt; 'modules/Accounts/Account.js',
      ),
    1 =&gt; 
      array (
        'file' =&gt; 'custom/modules/Accounts/Account1.js',
      ),
    ),
  </code></pre>
  
  <p>The details that i want to access from the <code>$current_user</code> is actually a customization that I made to the <code>User</code> module to add more configuration option for every user. </p>
  
  <p>I saw somewhere else on Google that i could use <code>var current_user = current_user;</code> in the custom Javascript file and it actually shows the user ID of the logged in user, however what i really want is to get the User detail Object, please does anyone have any ideas.</p>
  
  <p>Regards</p>