I added a button in the contact search layout which looks like this:

enter image description here

Since we need to push the package into App Exchange, I need to be able to add this into the package. I searched the components and don't find anything there. I also searched the forums and documents and only found this: https://stackoverflow.com/questions/8067099/how-to-add-search-layouts-in-salesforce-package . Since this post was 2011, is there any change on this?

1 Answer 1


No, you'd have to use a post-install configuration page (e.g. use the Metadata API Wrapper) to add the button "automatically," or provide the post-install instructions, just as you used to have to do all those years ago.

  • I browsed the github repository and metadata api for a while now. And still don't see metadata types related to search layout. Is that supported?
    – Lance Shi
    Aug 22, 2016 at 3:28
  • @LanceShi I don't actually see it in there, either... I suppose you'd have to hack it in. See the SearchLayouts object, which you'd have to add to CustomObject, in order to effect your changes.
    – sfdcfox
    Aug 22, 2016 at 3:32
  • @LanceShi it's in src/classes/MetadataService, there's a class called SearchLayouts. I'm not sure how to use it, but hopefully that points you in the right direction? Feel free to update this answer if you manage to get it working.
    – sfdcfox
    Aug 22, 2016 at 3:36

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.