Thursday, August 25, 2011

Create first plugin with Development Toolkit CRM 2011 Part 1.


Before we begin, let's create some additional entities. I want to create “Meeting” and “Resources” entities.
Entity Meeting should represent information about meeting, invited participants and needed resources. Meeting form should include such fields:
  • Meeting Name.
  • Location. 
  • Start date. 
  • End date. 
  • Description. 
  • Priority. 
  • Send Email to participant.


Also it should have 1:N relation to Contacts and Resources.
Entity Resources describes information about resources that are involved in the meeting. (Example: Projector, Microphones, Speakers and etc.)
Resources form should include such fields:
  • Name.

Get string value of OptionSet in CRM 2011

If you need to retrieve StateCode or StatusCode or other OptionSet of attribute, then simply use code bellow:


public static OptionMetadataCollection GetOptionsSetByAttribute(IOrganizationService service, string entityName, string attributeName)
{

var retrieveAttributeRequest = new RetrieveAttributeRequest();
retrieveAttributeRequest.EntityLogicalName = entityName;
retrieveAttributeRequest.LogicalName = attributeName;
retrieveAttributeRequest.RetrieveAsIfPublished = true;

var retrieveAttributeResponse = (RetrieveAttributeResponse)service.Execute(retrieveAttributeRequest);

var optionMetadataCollection = (((StatusAttributeMetadata) retrieveAttributeResponse.AttributeMetadata).OptionSet).Options;

//foreach (OptionMetadata optionMetadata in optionMetadataCollection)
//{
// Here you can add your advanced logic.....
// optionMetadata.Label.UserLocalizedLabel.Label = "Teset";
//}
// or simply return OptionMetadataCollection....
return optionMetadataCollection;

}

To use it just write:
OptionMetadataCollection metadatas = GetOptionsSetByAttribute(this.OrganizationService, "new_cars", "statuscode");   

Tuesday, August 23, 2011

Developing with Development Toolkit CRM 2011


You need to download and extract last CRM 2011 SDK.  In \sdk\tools\developertoolkit\ run crmdevelopertools_installer.msi to install toolkit.


First we need to create a New Project:  File -> New Project or press Ctrl+Shift+N 
In Dialog windows select Dynamics CRM Template and New Visual Studio Solution Template for Dynamics CRM 2011.
Enter a Name and Solution name.

Saturday, August 20, 2011

CRM 2011 Maintenance Job Editor

CRM 2011 Maintenance Job Editor - it has evolved from CRM 4.0 ScaleGroup Job Editor tool for working with CRM 2011. This utility is used to edit the schedule jobs to run services, such as rebuilding indexes, cleaning jobs workflow, etc.

Service jobs are assigned to the same time, the organization which is created in the CRM 2011. For example: You have created an organization at 13:00, then the job will run services for the organization every 24 hours, at 13:00. And that could create an additional load on the system that adversely affect your system's performance in "rush hour".

To use this utility, download it and copy the two files in the folder "C: \ Program Files \ Microsoft Dynamics CRM \ Tools" and run the EXE-file. Don't forget to play with the settings.

Thursday, August 11, 2011

SoapLogger

SoapLogger - is a console application (Visual Studio 2010) came with the CRM 2011 SDK, which allows you to receive the formatted SOAP requests and responses that you send through the code to the endpoint SOAP CRM 2011.

Uses:
Download and unzip the CRM 2011 SDK;
Open the project \ SampleCode \ CS \ Client \ SOAPLogger \ SOAPLogger.sln;

First Post.

Hello This is my first blog dedicated to MS CRM 2011. Here I will describe all the interesting things that are associated with MS CRM 2011.