Skip to main content
Paddy R ha preguntado en #Data Management
I have a custom button on Opportunity and in Javascript file I am trying to access User object custom field using the below code:

 

if( "{!$User.Field_Name__c}" == "false") - it does not return the value

 

and If I remove the double quotes 

 

if({!$User.Field_Name__c} == "false") - It says undefined.

 

And I am able to access Standard field of User object , only I am not able to access custom fields..

 

Is their any way I can access without writing any query in javascript code.

 

Thank you in adavcen

 

Regards,

 

Paddy
7 respuestas
  1. 12 oct 2013, 1:37
    Hey Paddy,

     

    Here are a couple suggestions:

     

    1. Use this script up top instead:

     

    {!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}

     

    2. Try using a merge field from the current object instead of $User and see what happens!

     

    Hope this helps!

     

    David