You need to sign in to do that
Don't have an account?
Luffy Carl_op
How can I get current user's custom field, not the standard field.
For example, if i add a custom field "myposition", how can i get it in apex class?
UserInfo.getMyposition() or UserInfo.myposition are both invalid.
UserInfo.getMyposition() or UserInfo.myposition are both invalid.
The only supported methods for the UserInfo class are those in the documentation:
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_userinfo.htm
If you want to get custom fields from the user object, you will have to do a SOQL query. Eg:
All Answers
The only supported methods for the UserInfo class are those in the documentation:
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_userinfo.htm
If you want to get custom fields from the user object, you will have to do a SOQL query. Eg: