You need to sign in to do that
Don't have an account?
daofu hu
Didn't understand relationship 'Account' in field path when quering User object
I have a customized Search page in my developer Edition.
And I used pagination feature to display search results.
After clicking the tab of the Search page, Search page displayed correctly
with executing correctly an Apex code to get User information with SOQL below when displaying the Search page.
Select ...
from User
Where
Account.Id = :accId
But when I click next page link of pagination feature, it runs error said below.
>>Didn't understand relationship 'Account' in the field path.
If I changed Account. Id to AccountId it runs correctly.
This error only happened by community user. This error didn't happen by internal manager user.
thanks for any hint.
And I used pagination feature to display search results.
After clicking the tab of the Search page, Search page displayed correctly
with executing correctly an Apex code to get User information with SOQL below when displaying the Search page.
Select ...
from User
Where
Account.Id = :accId
But when I click next page link of pagination feature, it runs error said below.
>>Didn't understand relationship 'Account' in the field path.
If I changed Account. Id to AccountId it runs correctly.
This error only happened by community user. This error didn't happen by internal manager user.
thanks for any hint.
Didn't understand relationship 'Account' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
hello daofu,
Can you please provide the complete code or the exact query what you are trying as I think Account.Id will not be recognised
when ever we do a relationship query we need to check the chilld object name in that. If you see AccountId is the api name and there is nothing like Account.id. in the below screen shots you can see that one behaves as object and other as ID. that's why you are getting error while doing.
Please mark it as as best answer if it helped you in any way.
thanks