crm 系统解决方案_如何将本地CRM组织的托管解决方案转换为非托管解决方案?...

crm 系统解决方案

Solution is very important part of Dynamics CRM. In order to deploy your customization, solution is the only bridge which help you to achieve your goal. There are two types of solutions available in CRM: Managed and Unmanaged.

解决方案是Dynamics CRM的重要组成部分。 为了部署您的定制,解决方案是帮助您实现目标的唯一桥梁。 CRM中有两种可用的解决方案:托管和非托管。

Managed Solutions:

托管解决方案:

This is the solutions that you can import and publish only. You neither export it nor you can make any changes in it.

这是只能导入和发布的解决方案。 您既不能导出它,也不能对其进行任何更改。

Unmanaged Solutions:

非托管解决方案:

It allows you to perform all operations like Import, Export, add/remove component, publish customization and lot other.

它允许您执行所有操作,例如导入,导出,添加/删除组件,发布自定义等等。

In this blog we are mainly focusing on restriction of Managed solution and how to convert Managed solution into Unmanaged one. Once you convert Managed solution into Unmanaged, then you can do anything with it.

在此博客中,我们主要关注托管解决方案的限制以及如何将托管解决方案转换为非托管解决方案。 将托管解决方案转换为非托管解决方案后,便可以执行任何操作。

Description & Solution:

说明与解决方案:

When you install any third party solution, mostly you will find them in Managed state.

当您安装任何第三方解决方案时,通常您会发现它们处于“受管”状态。

The reason behind this is, anonymous person cannot modify the component of Managed solution. In other words, it is in lock state.

其背后的原因是,匿名人员无法修改托管解决方案的组件。 换句话说,它处于锁定状态。

Suppose you come across the situation in which you need to export the Managed solution to deploy it on Production environment then you won’t be able to do that. Same way you cannot update any component within the solution.

假设您遇到需要导出托管解决方案以将其部署到生产环境的情况,那么您将无法做到这一点。 无法以相同方式更新解决方案中的任何组件。

After doing lot of research work I came up with below solution which help me to convert solution from managed state to unmanaged one.

经过大量的研究工作,我提出了以下解决方案,可帮助我将解决方案从托管状态转换为非托管状态。

This solution will only applicable on “on premise” version of Dynamics CRM.

该解决方案仅适用于Dynamics CRM的“内部”版本。

I will also suggest to take the backup of you CRM Database first.

我还将建议先备份您的CRM数据库。

Below is the SQL query which you have to use in order to convert Managed solution into Unmanaged one.

下面是您必须使用SQL查询,以便将托管解决方案转换为非托管解决方案。

DECLARE @solutionId UNIQUEIDENTIFIER  
 DECLARE @systemSolutionId UNIQUEIDENTIFIER  
 -- Please replace 'UNIQUE NAME OF YOUR MANAGED SOLUTION' with the name of your solution name.  
 SELECT   
   @solutionId = solutionid  
 FROM SolutionBase  
 WHERE   
   UniqueName='UNIQUE NAME OF YOUR MANAGED SOLUTION'  
 -- DO NOT TOUCH FROM HERE ON --  
 SELECT   
   @systemSolutionId = solutionid   
 FROM SolutionBase   
 WHERE UniqueName = 'Active'  
 UPDATE PublisherBase SET   
   IsReadonly=0  
 WHERE PublisherId IN (SELECT PublisherId FROM SolutionBase WHERE SolutionId = @solutionId)  
 PRINT 'Updated Publisher'  
 DECLARE @tables TABLE (   
   id     INT IDENTITY,   
   NAME    NVARCHAR(100),   
   ismanaged BIT,   
   issolution BIT   
 )  
 DECLARE   
   @count    INT,   
   @currentTable NVARCHAR(100),   
   @currentM   BIT,   
   @currentS   BIT,   
   @sql     NVARCHAR(max)   
 -- Go through all the tables that have the ismanaged or solutionid flag  
 -- Find the related records for the current solution and move them to the crm active solution.  
 INSERT INTO @tables (  
   NAME, ismanaged, issolution  
 )   
 SELECT   
   NAME, 1, 0   
 FROM  sysobjects   
 WHERE  
   id IN (SELECT id FROM syscolumns WHERE NAME IN ( 'IsManaged' ))   
   AND type = 'U'   
 ORDER BY NAME   
 INSERT INTO @tables (  
   NAME, ismanaged, issolution  
 )   
 SELECT  
   NAME, 0, 1   
 FROM  sysobjects   
 WHERE  
   id IN (SELECT id FROM syscolumns WHERE NAME IN ( 'SolutionId' ))   
     AND type = 'U'   
     AND NAME NOT IN ( 'SolutionComponentBase' )  
 ORDER BY NAME   
 -- Ignore this table because it doesn't make a difference.   
 -- It does cause dependency errors on the exported solution but we can manually edit the xml for that.  
 SELECT @count = Count(*)   
 FROM  @tables   
 WHILE ( @count > 0 )   
  BEGIN   
    SELECT @currentTable = NAME,   
        @currentM = ismanaged,   
        @currentS = issolution   
    FROM  @tables   
    WHERE id = @count   
    IF ( @currentM = 1 )   
     BEGIN   
       SELECT @sql = 'update ' + @currentTable   
              + ' set IsManaged=0 where SolutionId=N'''   
              + Cast(@solutionId AS NVARCHAR(100)) + ''''   
       EXEC (@sql)   
       PRINT 'updated IsManaged to 0 on: '   
          + @currentTable   
     END   
    IF ( @currentS = 1 )   
     BEGIN   
       SELECT @sql = 'update ' + @currentTable   
              + ' set SolutionId=N'''   
              + Cast(@systemSolutionId AS NVARCHAR(100))   
              + ''' where SolutionId=N'''   
              + Cast(@solutionId AS NVARCHAR(100)) + ''''   
       EXEC (@sql)   
       PRINT 'updated SolutionId on: ' + @currentTable   
     END   
    SELECT @count = @count - 1,   
        @currentTable = NULL   
  END   

Follow below steps once you done with above SQL Script.

完成上述SQL脚本后,请按照以下步骤操作。

Download the managed solution which you want to convert and search for MissingDependency tag in solution.xml file.

下载要转换的托管解决方案,并在solution.xml文件中搜索MissingDependency标记。

There will be many MissingDependency elements exists in solution.xml file. Please remove all of them and close the MissingDependency missing tag as <MissingDependency />

solution.xml文件中将存在许多MissingDependency元素。 请删除所有这些文件,然后将MissingDependency缺少标记关闭为<MissingDependency />

Now zip all files into single and again import in your organization.

现在,将所有文件压缩为单个文件,然后再次导入您的组织中。

That’s it..!!!

而已..!!!

Conclusion:
Some time you come across the situation with Managed solution in Microsoft CRM development and there is no way to overcome the situation unless you have some way to manage the changes. This blog will help you to resolve all your problems related to Managed solution.

结论:
有一段时间,您在Microsoft CRM开发中使用托管解决方案遇到了这种情况,除非您有某种方法来管理更改,否则就无法克服这种情况。 该博客将帮助您解决与托管解决方案有关的所有问题。

翻译自: https://www.systutorials.com/convert-managed-solution-unmanaged-premise-crm-organisation/

crm 系统解决方案

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值