• Carl Bussema
  • NEWBIE
  • 5 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

This has been reported (https://developer.salesforce.com/forums/?id=906F0000000fyRsIAI) before (https://salesforce.stackexchange.com/questions/187113/how-to-deploy-search-layout-containing-custom-fields) in different ways, I expect these two reports are symptoms of the same problem, namely that search layouts do not retrieve and/or deploy correctly using metadata API when they include custom fields and/or buttons.

Reproduce:

  1. Add a custom field to Product2 (enable FLS for all profiles to rule that out).
  2. Customize the Price Book Entry default search layout to include that new field
  3. Retrieve the Price Book Entry object using Metadata API
  4. Observe the search layout contains a nil field instead of the custom field.
Here's an example from our org, with 2 custom fields. 
 
<searchLayouts>
   <searchResultsAdditionalFields>PRODUCT.NAME</searchResultsAdditionalFields>
<searchResultsAdditionalFields>PRODUCT.CUSTOMER_PRODUCT_ID</searchResultsAdditionalFields>
        <searchResultsAdditionalFields xsi:nil="true"/>
     <searchResultsAdditionalFields>PRODUCT2.FAMILY_ENUM</searchResultsAdditionalFields>
        <searchResultsAdditionalFields xsi:nil="true"/>
    </searchLayouts>
This makes it impossible to deploy the search layout customization, and it must be recreated by hand in each environment.
 

This has been reported (https://developer.salesforce.com/forums/?id=906F0000000fyRsIAI) before (https://salesforce.stackexchange.com/questions/187113/how-to-deploy-search-layout-containing-custom-fields) in different ways, I expect these two reports are symptoms of the same problem, namely that search layouts do not retrieve and/or deploy correctly using metadata API when they include custom fields and/or buttons.

Reproduce:

  1. Add a custom field to Product2 (enable FLS for all profiles to rule that out).
  2. Customize the Price Book Entry default search layout to include that new field
  3. Retrieve the Price Book Entry object using Metadata API
  4. Observe the search layout contains a nil field instead of the custom field.
Here's an example from our org, with 2 custom fields. 
 
<searchLayouts>
   <searchResultsAdditionalFields>PRODUCT.NAME</searchResultsAdditionalFields>
<searchResultsAdditionalFields>PRODUCT.CUSTOMER_PRODUCT_ID</searchResultsAdditionalFields>
        <searchResultsAdditionalFields xsi:nil="true"/>
     <searchResultsAdditionalFields>PRODUCT2.FAMILY_ENUM</searchResultsAdditionalFields>
        <searchResultsAdditionalFields xsi:nil="true"/>
    </searchLayouts>
This makes it impossible to deploy the search layout customization, and it must be recreated by hand in each environment.
 
Hello,

After having been succesfull in Sandox, I'm loading UserTerritory2Association entries in Production (insert operation).
The load always fails with the message "invalid cross reference id". 
There is no additional indication about which ID is invalid (but I strongly doubt it is the case).

This operation was tested succesfully on a Sandbox which has been created/refreshed less than 24 hours ago.

The file to load is quite simple like in the excerpt below:

UserID,TerritoryId
0050O000008RxE5QAK,0MI0O0000004W0MWAU

IDs have been verified and really display a record (User and Territory) at each invocation.

What's happening ? Is it possible to perform this operaiton in Production ? 

Thank you for your help

FB