Skip to content

Commit 2283de8

Browse files
authored
Merge pull request #6154 from MicrosoftDocs/phecke-solution-async
Added new solution sample
2 parents 07e5df0 + a643b7c commit 2283de8

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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)]

powerapps-docs/developer/data-platform/org-service/samples/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@
268268
items:
269269
- name: Work with solutions
270270
href: work-solutions.md
271+
- name: Staging and async import
272+
href: solution-stage-and-import.md
271273
- name: Detect solution dependencies
272274
href: detect-solution-dependencies.md
273275
- name: Time zones

0 commit comments

Comments
 (0)