0

I'm unable to populate the Account.Name lookup value in a data table. Although its visible in console but not on the data table. enter image description here [enter image description here](https://i.sstatic.net/C3pNz.jpg)

1 Answer 1

0

Fields referenced in datatable mapping have to be "simple". Directly accessible properties on the object, without "jumping into" the nested object with dot notation.

  1. You could put a formula field on Contact, call it AccountName__c, then query that and reference that in the datatable.
  2. You can return a wrapper object created in Apex where stuff is appropriately flattened for easier use. It's more work, yes... but as your table's complexity increases the fact you have to write unit tests for it pays off when maintenance breaks something and you wouldn't notice otherwise.
  3. Or you can intercept the data in the @wire handler method and flatten it there. Check https://salesforce.stackexchange.com/a/379451/799 out.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.