5

I know how to retrieve the Metadata via this questions; Metadata - Case Search Layout

And I understand that they must be retrieved via the Object or Custom Object itself and the list of components editable via the Metadata API can be found here: https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_types_list.htm

It's getting quite thorough!

I am having difficulty, though, finding some examples on how to deploy Search Layout-specific syntax via Force.come IDE or ANT Migration Tool. Here you'll see the field labels are a bit different and then there's the actual deployment process.

Do you need to deploy the entire object with all parameters each time? Or can you just deploy the Object with only the changed Search layouts referenced?

Update It should be noted that the syntax for Search Layout is NOT the same as the API name. For ease of time, it's best to retrieve the objects using Force.com IDE or ANT and adjust then deploy.

  • Yea I want to know this too, and also the same question for the "RecordType" section of the Custom Object, the one containing picklist field values per record type. Can't deploy it either. – Kirill Yunussov Jul 9 '15 at 19:52
5

To deploy a Search Layout, you must deploy the CustomObject itself. All not-required tags can be stripped, but there is no way to simply deploy a search layout without the object.

This means you'd need something like this:

package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
  <types>
    <members>Account</members>
    <name>CustomObject</name>
  </types>
  <version>35.0</version>
</Package>

objects/Account.object:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <enableEnhancedLookup>true</enableEnhancedLookup>
    <enableFeeds>true</enableFeeds>
    <enableHistory>false</enableHistory>
    <searchLayouts>
       <!-- as per description in the documentation -->
    </searchLayouts>
    <sharingModel>Private</sharingModel>
</CustomObject>
  • Hi Charles, thank you for responding. I'll be getting to this shortly, but i'll circle back once i do and confirm. Thanks! – Ryan Berens Jan 20 '16 at 21:18
  • Hi Charles, Thanks! I was able to get this working just fine. The only issue I'm running into is that for custom objects on a managed package, i keep running into errors. Any thoughts? – Ryan Berens Feb 23 '16 at 19:01
  • @RyanBerens No clue. What errors? – Charles Koppelman Feb 23 '16 at 19:04
  • I couldn't deploy the custom object with a sharing rule of Controlled by Parent without providing the Master-Detail fields; however, when i included them it shot off an error stating that I couldn't add new fields. It may be that included too many attributes - really, i'm looking for the minimum i need. And then the other issue: i used teh full API name of a custom field in my searchlayout; and yet it's telling me it doesn't exist. ? Just a few things. – Ryan Berens Feb 23 '16 at 19:24
  • @RyanBerens Not sure. I don't deal much with managed packages. It may have something to do with whether or not you include a namespace. – Charles Koppelman Feb 23 '16 at 19:37

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.