Sunday 3 May 2015

Create Crm Associate Message using Developer Toolkit

dears,

if you want to add Associate message on parent entity when adding child records (association ) using developer toolkit, you will not find it.

To create plug-in using developer toolkit for message with no primary entity associated, you can create a plug-in as normal process and modify the generated .cs code file and the RegisterFile.crmregister file.

1. select any entity and create any plug-in message in CRM Explorer.
2. select any message to use, and configure other setting as you need for the message have no primary entity.
3. modify the generated .cs code file as below

base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(10, "Associate", "", new Action<LocalPluginContext>(ExecutePreValidatePostcodeAssociate)));

by update the message to the one have no primary entity and change the entity name to empty string

4. modify RegisterFile.crmregister file  as below:

<Step
 CustomConfiguration="" Name="PreValidatePostcodeAssociate"
Description="Pre-Validation of Postcode Associate"
Id="881876af-8ba0-e111-b344-00155d4c5b01" MessageName="Associate"
Mode="Synchronous" PrimaryEntityName="" Rank="1" SecureConfiguration=""
Stage="PreOutsideTransaction" SupportedDeployment="Both"

find the xml for previously generated plug-in, update the message and change entity name to empty string