Export (0) Print
Expand All
Expand Minimize

SetReportRelated Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online only

Links an instance of a report entity to related entities.

The relevant classes are specified in the following table.

TypeClass
RequestSetReportRelatedRequest
ResponseSetReportRelatedResponse

Remarks

To use this message, pass an instance of the SetReportRelated class as the request parameter in the Execute method.

For a list of required privileges, see SetReportRelated Privileges.

Example

The following code example shows how to use the SetReportRelated message.

[C#]
// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create a request.
SetReportRelatedRequest reportRelatedRequest = new SetReportRelatedRequest();
reportRelatedRequest.ReportId = new Guid("A8228F55-A868-DC11-9F6D-0003FFA48E24");
// Set the categories for the report.
reportRelatedRequest.Categories = (int[])categoryCodeIDs.ToArray(typeof(int));
// Set the relationships for the report.
reportRelatedRequest.Entities = new int[] { accountEntityMetadata.ObjectTypeCode.Value,
// Set the visibility for the report.
reportRelatedRequest.Visibility = (int[])visibilityCodeIDs.ToArray(typeof(int));

// Execute the request.
SetReportRelatedResponse reportRelatedResponse = (SetReportRelatedResponse)crmService.Execute(reportRelatedRequest);
[Visual Basic .NET]
' Set up the CRM Service.
Dim token As New CrmAuthenticationToken()
' You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0
token.OrganizationName = "AdventureWorksCycle";
 
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create a request.
Dim reportRelatedRequest As New SetReportRelatedRequest()
reportRelatedRequest.ReportId = New Guid("A8228F55-A868-DC11-9F6D-0003FFA48E24")

' Set the categories for the report.
reportRelatedRequest.Categories = CType(categoryCodeIDs.ToArray(GetType(Integer)), Integer())

' Set relationships.
reportRelatedRequest.Entities = New Integer() { accountEntityMetadata.ObjectTypeCode.Value, contactEntityMetadata.ObjectTypeCode.Value }
' Set the visibility for the report
reportRelatedRequest.Visibility = CType(visibilityCodeIDs.ToArray(GetType(Integer)), Integer())

' Execute the request.
Dim reportRelatedResponse As SetReportRelatedResponse = CType(crmService.Execute(reportRelatedRequest), SetReportRelatedResponse)

See Also

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft