1

I'm trying to deploy a PricebookEntry object containing a SearchLayout which contains standard and custom fields however I'm having issues when I include a custom field.

The following is what happens:

If I add the custom field to the search layout through the UI and I retrieve the metadata using the Force.com migration toolkit the searchLayout contains the following.

<searchLayouts>
    <searchResultsAdditionalFields>PRODUCT.NAME</searchResultsAdditionalFields>
    <searchResultsAdditionalFields xsi:nil="true"/>
    <searchResultsAdditionalFields>PRODUCT.DEFAULT_PRICE</searchResultsAdditionalFields>
    <searchResultsAdditionalFields>PRODUCT.CUSTOMER_PRODUCT_ID</searchResultsAdditionalFields>
    <searchResultsAdditionalFields>PRODUCT2.FAMILY_ENUM</searchResultsAdditionalFields>
</searchLayouts>

In this is at the position where I added the custom field to the searchLayout through the UI. If I deploy the same metadata back to the org it removes the custom field from the search layout. I've tried therefore to change the metadata as follows to add the custom field directly.

<searchResultsAdditionalFields>PRODUCT2.Manufacturer__c</searchResultsAdditionalFields>

but the following error is returned

  1. objects/PricebookEntry.object -- Error: In field: searchResultsFields - no CustomField named PricebookEntry.PRODUCT2.Manufacturer__c found

The Manufacturer__c field does exists on product2 though. Does anyone know how custom fields can be added to the search layout for deployment?

I noticed the following related post How do you deploy edited Search Layouts via Metadata API using ANT or Force.com IDE? but it does not provide a solution.

0

As an FYI. I opened a case with Salesforce on this. It's already a known bug (reported by a different customer) and is currently being actioned by R&D. I'm not sure when it will be resolved.

  • did you ever get an answer to this? – PepeFloyd Oct 14 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.