Thursday, December 29, 2011

CRM 2011 - Appointment plug-in in Pre-validation/Pre-creation stage with Create and Book message

If you want to registry a new plugin in CreateRequest message you have to consider that it can't be started.
Considering the following example :
You want subscribe, or register, an Appointment plug-in to the "pre-validation CreateRequest", in order to modify some appointment field.We would expect that it will run when the event occurs.

Now create a new appointment with start and end date 5 day after today.........surprise............!!!!!!! it doesn't run.
In this case the BookRequest message occurs and you have to subscrive, or register also your plug-in to BookRequest message, in order to triggering this event.

Nota:
I'm not sure but the BookRequest message should be substitute the information in the previous stage (CreateRequest in pre-validation) .

This shold be a big problem because if you want to use the Appointment plugin in ofline mode it doesn't work. Considering that the Book message work only in server mode!

In the following list you can find all appointment message :


MessageDescription
Adds recurrence information to an existing appointment to make it a recurring appointment master.
Assigns an appointment to another user or team.
Creates a link between a record and one or more records that participate in a relationship. You can also use theIOrganizationService.Associate method. For more information, seeActions on Entity Records. For a list of default relationships for this entity, see Appointment Entity Metadata.
Schedules or books an appointment.
Creates an appointment. You can also call theIOrganizationService.Create method.
Creates an exception for the recurring appointment instance,Appointment.InstanceTypeCode. For more information, seeCreate a Recurring Appointment Exception.
Deletes an appointment. You can also call theIOrganizationService.Delete method.
Removes a link between a record and one or more records that participate in a relationship. You can also use theIOrganizationService.Disassociate method. For more information, see Actions on Entity Records. For a list of default relationships for this entity, see Appointment Entity Metadata.
Shares an appointment with another security principal (user or team).
Initializes a new record from an existing record provided that an attribute map is defined for the two entities. For more information, see Customize Entity and Attribute Mappings.
Changes the access rights for an appointment previously shared with another security principal (user or team).
Reschedules an appointment.
Detects and retrieves duplicate records for the specified record, provided that duplicate detection is enabled and there are published duplicate detection rules for the entity. For more information, seeDetect Duplicate Data in Microsoft Dynamics CRM.
Retrieves an appointmentYou can also call theIOrganizationService.Retrieve method.
Retrieves a collection of appointments. You can also call theRetrieveMultiple method.
Retrieves the access that the specified security principal (user or team) has to an appointment.
Retrieves the security principals (users or teams) that have access to an appointment, together with their access rights to the appointment.
Removes all access to an appointment for the specified security principal (user or team).
Sets the state of an appointment. The possible values for this attribute are defined in the Appointment.State attribute. If you are using early bound types, you can use the AppointmentStateenumeration.
Updates an appointment. You can also call the Update method.
Validates that all the constraints of an appointment are met.



Nicola Grillo


Reference:
Microsoft Dynamics CRM 2011 SDK

Tuesday, December 20, 2011

CRM 2011 - The type initializer for 'Microsoft.Crm.LocatorService' threw an exception.

Typically the following exception :


Exception

An unhandled exception was generated during the execution of the current web request. 
Information regarding the origin and location of the exception can be identified using 
the exception stack trace below.  
The type initializer for 'Microsoft.Crm.LocatorService' threw an exception.


Appear when the iis service is down. In order to solve this problem you have to restart the service and whether an other error occured, as this:


Exception

The IIS Admin Service or the World Wide Web Publishing Service, or a service dep
endent on them failed to start.  The service, or dependent services, may had an
error during its startup or may be disabled.


You must check the related services and the disk space.


Nicola Grillo