web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

"Apply Solution Upgrade" in Code or with WebApi

(0) ShareShare
ReportReport
Posted on by

Hi,

I've been reading through the SDK 8.1 to find out how to:

1) Import a managed solution as Holding Solution
2) Apply Solution Upgrade

Purpose is to import my latest solution that include deletion of fields and hence get the fields removed from production environment.

I've managed to find answer for step number 1 by execution an ImportSolutionRequest:

ImportSolutionRequest impSolReq = new ImportSolutionRequest()
{
	CustomizationFile = fileBytes,
	PublishWorkflows = true,
	OverwriteUnmanagedCustomizations = false,
	HoldingSolution = true
};

This will import my solution as new holding solution. In the UI I can then press "Apply Solution Upgrade" to start the upgrade process.

I have not succeeded in finding the corresponding request for "Apply Solution Upgrade" in the SDK.

I'm running On-Premise CRM 2016 SP1 version 08.01.0000.0359

Hope someone have and can help me with an answer.

Kind regards,

Henrik

*This post is locked for comments

I have the same question (0)
  • Inogic Profile Picture
    703 on at

    Hi Henrik,

    You would like to publish that solution using Publish request. It won't actually act like Apply Upgrade but the changes publishing which was on hold will get published. You can refer to following MSDN link -

    https://msdn.microsoft.com/en-us/library/gg334390.aspx 

    Thanks!
    Sam

  • 9b6ad7017fc84be9b316418e6bfb40d0 Profile Picture
    on at

    Hi Sam,

    Thanks for you reply.

    As you wrote: Publishing will not "Apply the Upgrade" and I will end up with still having both the original solution installed and the holding solution.

    A little background: I'm working on building PowerShell CmdLet's to import our solution to automate deploy process from Dev to PreProd to Prod. And the scenario is: I'm working with managed solutions and in version 1 I create two new fields (FieldOne & FieldTwo). In version 2 of my manged solution I have deleted FieldTwo. I would like FieldTwo to be deleted during deploy to PreProd and Prod. Currently I can't seem to do that in Code or with WebApi.

    But, I've found out this weekend that the PackageDeployer will do what I need. If you import a managed solution with PackageDeployer and don't overwrite the customizations, then PackageDeployer will take care of the upgrade process. E.g. when I import version 2 of my solution version 1 will be upgraded with version 2 and FieldTwo will be deleted.

    I also noticed that the SDK 8.1 might not have been completely updated. Heres what it contains about "HoldingSolution".

    ImportSolutionRequest Class:

    snap1338.png

    WebApi ImportSolution Action:

    snap1338.png

    I will work with PackageDeployer for now and look forward to next release of the SDK.

    Thanks again for your comment.

    Regards,

    Henrik

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi there,

    the secret is hidden here:

    msdn.microsoft.com/.../microsoft.crm.sdk.messages.deleteandpromoterequest.aspx

  • Felipe Barboza de Lima Profile Picture
    15 on at

    The DeleteAndPromoteRequest is exactly what I was looking for.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans