function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GarrettzGarrettz 

Metadata API - CustomConsoleComponent on Layout

I believe there is a bug in retrieving the value for SideBarComponent field 'lookup' (https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_layouts.htm#SidebarComponent). We set a console component to look at the current record for a quick reference of fields on that record. When retrieving the Metadata, I noticed the entire container for that console component was missing. The retrieve of a value for a lookup to a related field worked though - i.e. Lead.Account__c was able to be retrieved.

I tried to update the file manually to get it to work, but couldn't figure out the value to pass in for it to reference itself. Salesforce appears to be looking for a field name, and after trying several differnt values ('ThisLead','Lead','Id',NULL) I couldn't get it to work. Any ideas if retrieving that information has a bug or even what the value should be to pass into the file?
Best Answer chosen by Garrettz
GarrettzGarrettz
Looks like this was fixed at some point. The retrieve I recently made included "self_lookup_component":
 
<containers>
                <isContainerAutoSizeEnabled>true</isContainerAutoSizeEnabled>
                <region>Left</region>
                <sidebarComponents>
                    <componentType>Lookup</componentType>
                    <lookup>self_lookup_component</lookup>
                </sidebarComponents>
                <style>Stack</style>
                <unit>Percentage</unit>
                <width>20</width>
            </containers>

All Answers

ShashankShashank (Salesforce Developers) 
If you are still facing the issue, could you please provide me the exact replication  steps so that I can try replicating the issue in a test environment?
GarrettzGarrettz
I haven't tried in a while, but to recreate:
  • Spin up a source Development Server
  • Build a Feedlayout (first noticed our issue on Leads but it appears to be accross all objects that support them)
  • Create a console component on any side (ours was on the left)
  • The console component should be of Type "lookup" and the Component should be "This Lead" (or any other object you selected):User-added image
  • Optional; create an additional custom component - I'm including this so when the metadata is pulled you will see this component and not the lookup component.
  • Build a package including the page layout
  • Open the file for the page layout and navigate to the console components; you'll notice the lookup is missing, but the option component exists:
User-added image

I believe the issue is because the metadata looks for the reference field to display in the lookup component, but since we are referencing the record itself there is no reference field. I couldn't fix this manually on the deployment file because I didn't know what to put for the reference field. We ended up deploying as is and manually configuring on the target server.
ShashankShashank (Salesforce Developers) 
This has been published as a known issue and is scheduled to be fixed in Spring '15: https://success.salesforce.com/issues_view?id=a1p30000000T57bAAC
GarrettzGarrettz
Thanks for the link, however I do not beleive that is the same issue. That states explicitly a custom object with a master-detail relationship. There is none of that in this issue.

This issue is specifically referencing the record itself as opposed to a related object. The markup should look something like this:
<customConsoleComponents>
    <primaryTabComponents>
       <containers>
          <region>Right</region>
          <sidebarComponents>
              <componentType>Lookup</componentType>
              <height>100</height>
              <lookup>ThisLead</lookup>
              <unit>Percentage</unit>
         </sidebarComponents>
         <style>Stack</style>
         <unit>Percentage</unit>
         <width>30</width>
     </containers>
  </primaryTabComponents>
<customConsoleComponents>
where "ThisLead" is the value to set to display fields for the current record. When retreiving a package with that type of custom console component the information is passed in if it's a lookup, but if it references the current object it doesn't have any value to pass in.
 
GarrettzGarrettz
Looks like this was fixed at some point. The retrieve I recently made included "self_lookup_component":
 
<containers>
                <isContainerAutoSizeEnabled>true</isContainerAutoSizeEnabled>
                <region>Left</region>
                <sidebarComponents>
                    <componentType>Lookup</componentType>
                    <lookup>self_lookup_component</lookup>
                </sidebarComponents>
                <style>Stack</style>
                <unit>Percentage</unit>
                <width>20</width>
            </containers>
This was selected as the best answer