2013-03-15 56 views
2

道歉,如果这是非常明显的,但我不能找到有关如何通过SDK从组织中删除解决方案的信息。如何使用CRM SDK删除解决方案?

我已经使用ImportSolutionRequest对象成功完成了导入,但无法找到删除解决方案的等价物。

回答

4

MS具有引导了MSDN上here

从该链接

using (_serviceProxy = ServerConnection.GetOrganizationProxy(serverConfig)) 
{ 
    // This statement is required to enable early-bound type support. 
    _serviceProxy.EnableProxyTypes(); 

    // Delete a solution 
    QueryExpression queryImportedSolution = new QueryExpression 
    { 
     EntityName = Solution.EntityLogicalName, 
     ColumnSet = new ColumnSet(new string[] { "solutionid", "friendlyname" }), 
     Criteria = new FilterExpression() 
    }; 
    queryImportedSolution.Criteria.AddCondition("uniquename", ConditionOperator.Equal, ImportedSolutionName); 
    Solution ImportedSolution = (Solution)_serviceProxy.RetrieveMultiple(queryImportedSolution).Entities[0]; 
    _serviceProxy.Delete(Solution.EntityLogicalName, (Guid)ImportedSolution.SolutionId); 
} 
+0

谢谢,这看起来太棒了! – 2013-03-18 10:08:29

相关问题