Search This Blog

Wednesday, May 15, 2013

Auto Numbering for MS CRM 2011

Implementation Procedure

 

1.     Import Auto-Number solutions and publish customisation

2.     Go to setting > Auto Number

a.     Create entity record ( Make sure you create new record for each entity for which you want to use AutoNumber )

                              i.    Make sure all the required field is completed and entity name and field name is correct (us name not schema name, usually all lowercase)

This is an example:
            
Target field is a field which will hold the auto number which is generated

 

            

For adding criteria to generate AutoNumber you need to add the XML in “field Mapping” column.

The format of the XML has to be as below

 

<?xml version="1.0" encoding="utf-8"?>

<Fields>

    <Field>

      <fieldname>ownershipcode</fieldname>

      <parameter>

        <value>1</value>

        <prefix>PUB</prefix>

        <suffix></suffix>

      </parameter>

      <parameter>

        <value>2</value>

        <prefix>PRV</prefix>

        <suffix></suffix>

      </parameter>

      <parameter>

        <value>3</value>

        <prefix>SUB</prefix>

        <suffix></suffix>

      </parameter>

      <parameter>

        <value>4</value>

        <prefix>OTR</prefix>

         <suffix>INT</suffix>

      </parameter>

    </Field>

  </Fields>

 

 

In the XML above, the field is “ownershipcode” and for each different type of ownership of organization different prefix and suffix can be added.

 

 

For creating AutoNumber without any criteria you need to add the XML in “field Mapping” column.

The format of the XML has to be as below

 

<?xml version="1.0" encoding="utf-8"?>

<Fields>

    <Field>

      <fieldname>NA</fieldname>

      <parameter>

        <value>1</value>

        <prefix>COMM</prefix>

        <suffix></suffix>

      </parameter>

      </Field>

  </Fields>

 

Use the same format and in fieldname use “NA” and add your prefix and Suffix if required

This will generate not conditional Auto Numbers

 
3.     Launch plug-in register(available in CRM SDK) and connect to your deployment

4.     Add trigger in plug-in register – you will find an assembly name (Assembly) counter. Just select it

 

 
 
a.     Then under register, select new step

b.    Make sure you have created the record in Auto Number entity before you register any steps

c.     Make sure you register it as Post-operation pipeline

d.    Make sure you register step for each entity for which you want to use autonumber




 
PS : Solution and Plugin code available at codeplex

https://autonumbercrm2011.codeplex.com/


 

 

CRM 2011 Timeouts and Limits

Timeouts

Limits


Wednesday, January 2, 2013

Debug Plugins on your local PC without Remote Debugger


1.       Download Latest MS CRM 2011 SDK ( latest version has Plugin Profiler Implemented)

2.       Click on Install Profiler on Menu Bar ( if it is not installed in your plugin registration tool )

3.       You will find a new node added to your plugin registration tool


4.       Select your plugin step from your plugin and Enable Plugin Profiling



 5.       After enabling profile the screen will look like as below



 6.       Once your plugin step is in profile mode, start your MS CRM and fire the plugin from MS CRM, and Download and save the log file generated by profiling action at one location.

7.       In Visual Studio open your plugin and attach the to Process “Plugin Registration.exe” , and add breakpoint in your code where you want to start debugging.

8.       Then Click on Debug option in your plugin registration tool , you  will see the window as below

 
 



 

9.       In the Profile Location section please provide the file path which you have download at the time of firing plugin , also provide the name of the file in the path

10.   In the second option provide path of your Assembly file along with filename

11.   In the same section after providing the file name select the plugin you want to debug



 

12.   Click on “Start Plug-in Execution” button

13.   This will start the execution of your plugin and it will step into your code at the debug point



 

Your screen with debugging will look like as above

Happy debugging plugin for any MS CRM server without remote debugger or Visual Studio to be installed on MS CRM server