How to Commit and Deploy Search Layouts with Copado

Search layouts don't have their own metadata type, therefore they cannot be selected in the metadata grid in Copado unlike, for example, objects (CustomObject), fields (CustomField), layouts (Layout) or workflow rules (WorkflowRule). Because of this, the only way of committing them is selecting the component to which they belong, which is the object (CustomObject).

If you need to commit and deploy a change that was made in a search layout in the Account object, the entire Account object will have to be committed. This will commit any changes made in the search layout.

An important thing to consider when committing search layouts is that, as previously mentioned, search layouts will be committed if you select the object, however, if an extra component that is part of that object is also selected, only the changes made in that component will be pushed to Git and not the search layouts.

Let’s take a look at the example below to see how this works.

You have made two changes in the Account object. One of them is a field addition to one of the search layouts, and the other one is a field creation in the Account object. Both, search layouts and fields, are located in the xml file of the Account object. If you select the Account object and the field, only the field will be pushed to Git. In order to commit also the search layouts, you only need to select the Account object. This will also push the field into Git, but it will not be deployed since it will not be listed in the deployment components.

How did we do?