0
List<Account> accName =  [Select Id,Name from Account where Account_Owner__c = : UserInfo.getUserId()];

i just want to get all the account where account owner = current login user

closed as unclear what you're asking by Derek F, Reshma, Jayant Das, battery.cord, glls Apr 26 at 13:44

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    What is the issue you are facing ? Are you populating Account_Owner__c field with the Owner of Account ? – Vijay Ganji Apr 26 at 6:17
1

To get account owner you need to use OwnerId field, see below code snippet.

List<Account> accName =  [Select Id,Name from Account where OwnerId = : UserInfo.getUserId()];

Not the answer you're looking for? Browse other questions tagged or ask your own question.