|
| 1 | +--- |
| 2 | +title: "Create solution patches | MicrosoftDocs" |
| 3 | +description: "Learn how to create solution patches" |
| 4 | +ms.custom: "" |
| 5 | +ms.date: 02/04/2020 |
| 6 | +ms.reviewer: "" |
| 7 | +ms.service: powerapps |
| 8 | +ms.suite: "" |
| 9 | +ms.tgt_pltfrm: "" |
| 10 | +ms.topic: "article" |
| 11 | +applies_to: |
| 12 | + - "Dynamics 365 (online)" |
| 13 | + - "Dynamics 365 Version 9.x" |
| 14 | + - "powerapps" |
| 15 | +author: "Mattp123" |
| 16 | +ms.assetid: |
| 17 | +caps.latest.revision: 15 |
| 18 | +ms.author: "matp" |
| 19 | +manager: "kvivek" |
| 20 | +search.audienceType: |
| 21 | + - maker |
| 22 | +search.app: |
| 23 | + - PowerApps |
| 24 | + - D365CE |
| 25 | +--- |
| 26 | + |
| 27 | +# Create solution patches |
| 28 | +A patch contains only the changes for a parent managed solution, such as adding or editing components and assets. When patches are imported, they’re layered on top of the parent solution. When you clone a solution, the system rolls up all related patches into the base solution and creates a new version. |
| 29 | + |
| 30 | + When you’re working with patches and cloned solutions, keep the following information in mind: |
| 31 | + |
| 32 | +- A patch represents an incremental minor update to the parent solution. A patch can add or update components and assets in the parent solution when installed on the target system, but it can’t delete any components or assets from the parent solution. |
| 33 | + |
| 34 | +- A patch can have only one parent solution, but a parent solution can have one or more patches. |
| 35 | + |
| 36 | +- A patch is created for an unmanaged solution. You can’t create a patch for a managed solution. |
| 37 | + |
| 38 | +- When you export a patch to a target system, you should export it as a managed patch. Don’t use unmanaged patches in production environments. |
| 39 | + |
| 40 | +- The parent solution must be present in the target system to install a patch. |
| 41 | + |
| 42 | +- You can delete or update a patch. |
| 43 | + |
| 44 | +- If you delete a parent solution, all child patches are also deleted. The system gives you a warning message that you can’t undo the delete operation. The deletion is performed in a single transaction. If one of the patches or the parent solution fails to delete, the entire transaction is rolled back. |
| 45 | + |
| 46 | +- After you have created the first patch for a parent solution, the solution becomes locked, and you can’t make any changes in this solution or export it. However, if you delete all of its child patches, the parent solution becomes unlocked. |
| 47 | + |
| 48 | +- When you clone a base solution, all child patches are rolled up into the base solution and it becomes a new version. You can add, edit, or delete components and assets in the cloned solution. |
| 49 | + |
| 50 | +- A cloned solution represents a replacement of the base solution when it’s installed on the target system as a managed solution. Typically, you use a cloned solution to ship a major update to the preceding solution. |
| 51 | + |
| 52 | +## Understanding version numbers for cloned solutions and patches |
| 53 | + A solution’s version has the following format: major.minor.build.revision. A patch must have a higher build or revision number than the parent solution. It can’t have a higher major or minor version. For example, for a base solution version 3.1.5.7, a patch could be a version 3.1.5.8 or version 3.1.7.0, but not version 3.2.0.0. A cloned solution must have the version number greater than or equal to the version number of the base solution. For example, for a base solution version 3.1.5.7, a cloned solution could be a version 3.2.0.0, or version 3.1.5.7. In the UI, you can only set the major and minor version values for a cloned solution, and the build or revision values for a patch. |
| 54 | + |
| 55 | + |
| 56 | +## Create a solution patch |
| 57 | + A patch contains changes to the parent solution, such as adding or editing components and assets. You don’t have to include the parent’s components unless you plan to edit them. |
| 58 | + |
| 59 | +## Create a patch for an unmanaged solution |
| 60 | + |
| 61 | +1. Go to the Power Apps portal, and then select **Solutions**. |
| 62 | + |
| 63 | +2. In the solutions list, select an unmanaged solution to create a patch for. On the command bar, select **Clone**, and then select **Clone a Patch**. The right pane that opens contains the base solution’s name and the patch version number. Select **Save**. |
| 64 | + > [!div class="mx-imgBorder"] |
| 65 | + > <img src="media/clone-a-patch.png" alt="Clone a patch" height="735" width="408"> |
| 66 | + |
| 67 | +3. In the solutions list, find and open the newly created patch. Notice that the unique name of the solution has been appended with _Patch_*hexnumber*. Just like with the base solution, add the components and assets you want. |
| 68 | + |
| 69 | +### Create a patch using solution explorer |
| 70 | + The following illustrations provide an example of creating a patch for an existing solution. Start by selecting **Clone a Patch** (in the compressed view, the **Clone a Patch** icon is depicted as two small squares, as shown below). |
| 71 | + |
| 72 | + > [!div class="mx-imgBorder"] |
| 73 | + >  |
| 74 | + |
| 75 | + In the **Clone To Patch** dialog box you see that the version number for the patch is based on the parent solution version number, but the build number is incremented by one. Each subsequent patch has a higher build or revision number than the preceding patch. |
| 76 | + |
| 77 | +  |
| 78 | + |
| 79 | + The following screenshot shows the base solution **SegmentedSolutionExample**, version **1.0.1.0**, and the patch **SegmentedSolutionExample_Patch**, version **1.0.2.0**. |
| 80 | + |
| 81 | + > [!div class="mx-imgBorder"] |
| 82 | + >  |
| 83 | + |
| 84 | + In the patch, we added a new custom entity called `Book`, and included all assets of the `Book` entity in the patch. |
| 85 | + |
| 86 | +  |
| 87 | + |
| 88 | +## Clone a solution |
| 89 | + When you clone an unmanaged solution, the original solution and all patches related to the solution are rolled up into a newly created version of the original solution. After cloning, the new solution version contains the original entities plus any components or entities that are added in a patch. |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +> [!IMPORTANT] |
| 94 | +> Cloning a solution removes the original solution and associated patches. |
| 95 | + |
| 96 | +1. Go to the Power Apps portal, and then select **Solutions**. |
| 97 | + |
| 98 | +2. In the solutions list, select an unmanaged solution to create a clone. On the command bar, select **Clone**, and then select **Clone Solution**. The right pane displays the base solution’s name and the new version number. Select **Save**. |
| 99 | + |
| 100 | +### See also |
| 101 | +[Solutions overview](solutions-overview.md) |
0 commit comments