0

I've got one head scratcher of a problem that I can't seem to find a solution for.

I have one Contact object which has lookup relationship on account. I have created Custom setting and added releted fields(Account) in it. At the time of accessing the Custom setting on VF page, i am getting an error.

Unknown property '$ObjectType.Contact.fields.Account' Error is in expression '{!$ObjectType.Contact.fields[contactField].Label}{!IF(contactSortField =='#{contactField}',IF(contactSortOrder='asc','?','?'),'')}' in component in page globalsearch Error evaluating dynamic reference 'Account'

thnx in advanced

3
  • try AccountId hope it will work
    – Harshi
    Feb 26, 2015 at 10:40
  • thnx for reply !!! bt nope it is not working i already tried AccounId...:( and it is showing error :::::duplicate field selected: AccountId Error is in expression '{!performSearch}' in page globalsearch: Class.GlobalContactSearch.getContactDataSet: line 530, column 1 Class.GlobalContactSearch.performSearch: line 196, column 1
    – Tanmay
    Feb 26, 2015 at 10:43
  • Are you trying to access field labels for things like Account.Name, Account.Phone, etc but using $ObjectType.Contact? I don't think that is going to work. You'll need to use $ObjectType.Account Feb 26, 2015 at 14:38

1 Answer 1

1

1) you need to use AccountId in that merge expression
2) if you are then getting a duplicate field selected error, you need to examine the code being called. I assume that your getContactDataSet method is building a dynamic query, so you should probably hold all the potential query fields in a Set<String> before building the query string from them. Perhaps I can offer more direct help if you post the apex code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .