You need to sign in to do that
Don't have an account?
![Carl Bussema Carl Bussema](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Metadata API retrieves incomplete data for Search Layout with Custom Fields
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:
- Add a custom field to Product2 (enable FLS for all profiles to rule that out).
- Customize the Price Book Entry default search layout to include that new field
- Retrieve the Price Book Entry object using Metadata API
- Observe the search layout contains a nil field instead of the custom field.
<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.
Did you find a way to deploy for PriceBookEntry too ?
Thanks
I succeded to deploy it.