Account Lookup Dialogs - Search Layout Configuration
Salesforce allows each org to configure the columns to be displayed whenever user clicks on Account lookup component.
This can be configured by navigating to
Settings -> Build -> Accounts -> Search Layouts -> Account Lookup Dialogs
and there appears a multi-select picklist where Administrator can add or remove columns of Account object.
Intention behind Configuring Search Layout
I am assuming Administrator would add only key columns from the Account object to the Lookup Dialog Layout which would help the user to decide whether he is picking the right Account at first glance.
My current Salesforce App
I am building a Custom Application where I display some information of Account objects in apex:dataTable. Currently the list of Columns displayed for Accounts are hard coded.
- Account Name
- Account Site
Requirements for my Salesforce App
- Each customer have their own custom field on Account which helps them to uniquely narrow down to a particular Account.
- So I don't want to hard code these fields, but to display the list of fields configured in Search Layouts of Account Lookup Dialogs.
Now coming to the problem, I tried many ways to reuse the existing Salesforce configuration but couldn't find one.
- Approach 1 - find a component which displays the List of Account in UI with a given Lookup Layout
- Approach 2 - find someway to read the org settings
- Approach 3 - Give a custom page in my App to configure Account object columns and read the config when displaying the dataTable.
Currently I am proceeding with Approach 3 but I find it redundant and hard to keep my custom config and Search Layout config in Sync.
Is there any better approach to achieve the same ?