Just sharing a simple scenario to understanding the working of Patches with Managed solution,
Create a solution named Test Solution with Contact entity in it. (with Add All Assets option)
- Imported it in another Target Org as Managed.
- Now I want to change the width of the section so that label is clearly visible for Preferred Method of Contact field.
- And we also add a new custom field named Middle Name in the form.
- Instead of deploying the complete solution again, we can create a Patch which includes these changes.
- In our Dev let us do the changes
- Now click Clone a Patch button for the Test Solution.
- In the solution add only the 2 components Main Form and the newly created Middle Name field in the patch solution.
- Export this Patch Solution as Managed and import it in the target org.
- In target Org after import of Patch we can see our changes.
- Now suppose we make few other changes like removing the Fax field from the form (below mobile phone field) and want to deploy the entire solution and don’t need the patch anymore.
- For this select Clone Solution button
- This will make all the patches rolled up to the newer version of the solution.
- This will auto-remove the patch solution created.
- Now let us import this to our Target org. Target org. will auto detect the upgrade to the solution.
- After import, select Apply Solution Upgrade
- This will auto remove the TestSolution_Upgrade and TestSolution_Patch and merge all the changes into one newer version of TestSoluiton.
- And as expected Fax field removed.
Hope it helps.