[SalesForce] What file structure is required when setting deployOptions.singlePackage to False

In using the metadata API to delete validation rules today, I ran into the issue described in this post, where i needed to set deployOptions.singlePackage to true, in order for the rules to get deleted.

I understand that this setting indicates the structure of the zip file, as per the docs on the deploy method.

Indicates whether the specified .zip file points to a directory structure with a single package (true) or a set of packages (false).

However, it seems like all of the samples in the documentation use the structure where singlePackage = true. I have not been able to find an example of deploying with singlePackage = false.

Given that the default value (at least in workbench) is false, I would like to understand what file structure is expected in order to successfully deploy using singlePackage = false.

Best Answer

I thought I'd try this, but in reverse.

Using my new found knowledge that you can pull a changeset with the Metadata API I used two random unmanaged packages as samples for a retrieve operation via Workbench.

enter image description here

Note that SinglePackage is unchecked and both changeset names are defined.

enter image description here

After Retrieve: enter image description here

The fileProperties above do a pretty good job of indicating the zip structure. At the top level are folders with each of the unmanaged package names.

enter image description here

For fun I:

  • extracted the Zip
  • updated the description field in the package.xml files with a "- Updated" suffix
  • zipped the top level folders back up into a single zip again.
  • deployed the result with workbench (with Single Package unchecked).

Workbench multiple packages: enter image description here

Deploy result: enter image description here

The unmanaged package descriptions were updated with my "- Updated" suffix.

enter image description here


Do keep and eye on Salesforce DX and the packaging 2.0 changes. I wouldn't be surprised to see more utilization or changes in this area going forward.