AddSolutionComponentRequest 클래스
Contains the data that is needed to add a solution component to an unmanaged solution.
네임스페이스: Microsoft.Crm.Sdk.Messages
어셈블리: Microsoft.Crm.Sdk.Proxy(Microsoft.Crm.Sdk.Proxy.dll에 있음)
구문
‘선언
<DataContractAttribute(Namespace:="https://schemas.microsoft.com/crm/2011/Contracts")> _
Public NotInheritable Class AddSolutionComponentRequest
Inherits OrganizationRequest
[DataContractAttribute(Namespace="https://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class AddSolutionComponentRequest : OrganizationRequest
예제
The following example shows how to use this message. For this sample to work correctly, you must be connected to the server to get an IOrganizationService interface. For the complete sample, see the link later in this topic.
The following code example adds the account entity to a solution that is specified in the SolutionUniqueName property.
// Add an existing Solution Component
//Add the Account entity to the solution
RetrieveEntityRequest retrieveForAddAccountRequest = new RetrieveEntityRequest()
{
LogicalName = Account.EntityLogicalName
};
RetrieveEntityResponse retrieveForAddAccountResponse = (RetrieveEntityResponse)_serviceProxy.Execute(retrieveForAddAccountRequest);
AddSolutionComponentRequest addReq = new AddSolutionComponentRequest()
{
ComponentType = (int)componenttype.Entity,
ComponentId = (Guid)retrieveForAddAccountResponse.EntityMetadata.MetadataId,
SolutionUniqueName = solution.UniqueName
};
_serviceProxy.Execute(addReq);
설명
Message Availability
이 메시지가 작동하려면 호출자가 서버에 연결되어야 합니다.
Usage
Pass an instance of this class to the Execute method, which returns an instance of AddSolutionComponentResponse class.
Privileges and Access Rights
To perform this action, the caller must have the privileges that are listed in AddSolutionComponent Privileges.
Notes for Callers
The componenttype enumeration defines the supported range of values for this property. You can access the available values by including the SampleCode\CS\HelperCode\OptionSets.cs file or the SampleCode\VB\HelperCode\OptionSets.vb file in your project.
An alternative to using this message is to create or update the solution component for a specific solution. When you use this technique, you add the solution component to both the default solution and the specified solution. You can implement the specific-solution technique in two ways.
Use the SolutionUniqueName parameter on the solution component create and update requests.
Pass the SolutionUniqueName optional parameter to the CreateRequest or UpdateRequest.
Use the SolutionUniqueName parameter on the solution component create and update requests.
For solution components that have a create or update request message that includes the SolutionUniqueName property, passing the unique name of the solution adds the solution component to that solution. The following messages include a SolutionUniqueName property:
Pass the SolutionUniqueName optional parameter to the CreateRequest or UpdateRequest.
For other solution components, add “SolutionUniqueName” as a parameter to the Parameters property when you use the CreateRequest or UpdateRequest messages. For more information, see Pass Optional Parameters in Messages.
Supported Entities
This message can only be used for valid solution components.
Adding Application Ribbons to a Solution.
When you use AddSolutionComponentRequest to add application ribbons to your solution, you must make sure to include the RibbonCustomization solution component that is associated with the active solution. Use the Active Solution.SolutionId in the query expression you use to retrieve the RibbonCustomization record.
QueryExpression query = new QueryExpression("ribboncustomization");
query.ColumnSet = new ColumnSet("ribboncustomizationid");
query.Criteria = new FilterExpression();
query.Criteria.AddCondition("entity", ConditionOperator.Null);
query.Criteria.AddCondition("solutionid", ConditionOperator.Equal, new Guid("{FD140AAE-4DF4-11DD-BD17-0019B9312238}"));
RetrieveMultipleRequest req = new RetrieveMultipleRequest();
req.Query = query;
RetrieveMultipleResponse resp = (RetrieveMultipleResponse)_context.Execute(req);
RibbonCustomization activeRibbonCustomization = (RibbonCustomization)resp.EntityCollection[0];
상속 계층
System.Object
Microsoft.Xrm.Sdk.OrganizationRequest
Microsoft.Crm.Sdk.Messages.AddSolutionComponentRequest
스레드 보안
이 형식의 공용 정적(Visual Basic에서는 Shared) 구성원은 스레드로부터 안전합니다. 인스턴스 구성원은 스레드로부터 안전하지 않을 수 있습니다.
플랫폼
Development Platforms
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Target Platforms
Windows Server 2008,Windows Server 2012,Windows 7
Change History
참고 항목
참조
AddSolutionComponentRequest 구성원
Microsoft.Crm.Sdk.Messages 네임스페이스
AddSolutionComponentResponse
Constant SolutionId Values
기타 리소스
AddSolutionComponent Privileges
Sample: Work With Solutions
Work with Solutions
SolutionComponent Entity Messages and Methods
Dependency Tracking for Solution Components
Send comments about this topic to Microsoft.
© 2015 Microsoft. All rights reserved.