|
| 1 | +--- |
| 2 | +title: "Sample: Solution staging with asynchronous import (Microsoft Dataverse) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces |
| 3 | +description: "Demonstrates how to stage and asynchronously import a solution." # 115-145 characters including spaces. This abstract displays in the search result. |
| 4 | +ms.custom: "" |
| 5 | +ms.date: 04/05/2022 |
| 6 | +ms.reviewer: |
| 7 | +ms.topic: sample |
| 8 | +author: "phecke" # GitHub ID |
| 9 | +ms.author: "pehecke" # MSFT alias of Microsoft employees only |
| 10 | +manager: "kvivek" # MSFT alias of manager or PM counterpart |
| 11 | +search.audienceType: |
| 12 | + - developer |
| 13 | +search.app: |
| 14 | + - PowerApps |
| 15 | + - D365CE |
| 16 | +--- |
| 17 | + |
| 18 | +# Sample: Solution staging with asynchronous import |
| 19 | + |
| 20 | +<!-- https://docs.microsoft.com/dynamics365/customer-engagement/developer/sample-work-solutions --> |
| 21 | + |
| 22 | +This sample shows how to perform the following actions with solutions: |
| 23 | + |
| 24 | +- Stage a solution and check the validation results |
| 25 | +- Import the staged solution using an asynchronous job and check for job completion |
| 26 | + |
| 27 | +You can download the sample from [here](https://github.com/microsoft/PowerApps-Samples/tree/master/cds/orgsvc/C%23/SolutionStagingAndImport). |
| 28 | + |
| 29 | +## How to run this sample |
| 30 | + |
| 31 | +[!include[cc-how-to-run-samples](../../includes/cc-how-to-run-samples.md)] |
| 32 | + |
| 33 | +Be sure to edit the App.config file and set the Username, Password, and Url values for your test environment. |
| 34 | + |
| 35 | +## What this sample does |
| 36 | + |
| 37 | +This sample shows how to stage (load) a solution in a Microsoft Dataverse environment and check the solution validation results. This enables you to check for a valid solution staging prior to solution import. Next, the sample performs an asynchronous import of the staged solution. An asynchronous job allows for importing large solutions and avoiding a timeout error. |
| 38 | + |
| 39 | +## How this sample works |
| 40 | + |
| 41 | +In order to simulate the scenario described in [What this sample does](#what-this-sample-does), the sample will do the following: |
| 42 | + |
| 43 | +### Setup |
| 44 | + |
| 45 | +1. Invokes the SampleHelpers.Connect method to authenticate the user and return a web service reference. |
| 46 | + |
| 47 | +### Demonstrate |
| 48 | + |
| 49 | +1. The `StageSolution` method reads the compressed solution file and stages the solution. |
| 50 | +1. The `ImportSolution` method imports the solution using an asynchronous job. |
| 51 | +1. The `CheckImportStatus` method waits for the asynchronous job to complete and checks the job for a successful status. |
| 52 | + |
| 53 | +### Clean up |
| 54 | + |
| 55 | +The program does not automatically delete the imported solution. You should manually delete the solution named "Contoso sample" from your test environment. |
| 56 | + |
| 57 | +[!INCLUDE[footer-include](../../../../includes/footer-banner.md)] |
0 commit comments