+ Start a Discussion
SFDC developer55SFDC developer55 

Custom Button Onclick issue using Javascript

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

I have a custom button in communities and on click of that this javascript method file get called..

 

And below code is not working.. it is giving undefined//

alert ("{!$User.CustomField__c}")

 

However, it is working fine for the standard field..For e.d below code is working fine .. I am able to see the Id but same thing is not working for the Custom field.

alert ("{!$User.Id}")

 

 

Thank you for the help in advance.

 

Regards,

Paddy

Best Answer chosen by Admin (Salesforce Developers) 
JK84JK84

Hi Paddy,

 

Can you check if the permissions on the custom field are provided to the profile for which the community is enabled ?

 

Once you find out the profile for which the community access is enabled, you can check the field permissions from the following path :

 

Manage users -> Profiles -> select the profile -> Field level security.

 

 

Note: Please mark this as solution, if it resolves your issue, so that its available for others.

 

Thanks

JK

 

All Answers

JK84JK84

Hi Paddy,

 

Can you check if the permissions on the custom field are provided to the profile for which the community is enabled ?

 

Once you find out the profile for which the community access is enabled, you can check the field permissions from the following path :

 

Manage users -> Profiles -> select the profile -> Field level security.

 

 

Note: Please mark this as solution, if it resolves your issue, so that its available for others.

 

Thanks

JK

 

This was selected as the best answer
SFDC developer55SFDC developer55

Than you very much