Search This Blog

Showing posts with label Mapping Issue. Show all posts
Showing posts with label Mapping Issue. Show all posts

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/


 

 

Sunday, February 13, 2011

why can't new the Topic attribute map in Lead's account_originating_lead relationship?

Problem :

I want the "Topic" data to automatically pull over from the lead record when the lead is converted to an account. I created a new attribute called "Originating topic" on Account form (type, format, and length are all same as Lead's topic attribute). And then try to create a mapping for it in Lead's account_originating_lead relationship, but it always pops up an error stating this attribute map is invalid. A vaild attribute map must meet these requirements: - The data type must match. - The length of the target attribute cannot be shorter than the source attribute. ....
I am sure the map meets those requirements.  And I created a map for another attribute, it works.
so I was wondering why the map for "topic" cannot be created. how do I solve this?
Appricate any advice.

Soln :
Both the Source and Target fields have to be published on the forms for their entities.  But you know what?  That's not enough.  Why?  Because CRM is lying to you .  Open your Metadata Browser to the following location, and tell me what you see for the "Subject" field:
http://<crm server>/<org>/sdk/mdbrowser/entity.aspx?entity=lead
The length is different, isn't it?  Why?  Because CRM is superior to you in every way, and it wants to make you feel like a small boy in the middle of a Civil War.  Apparently there's a mismatch in what the Metadata knows, and what the customization UI represents.  The fix?  Simply increase your target attribute to the length identified by the Metadata.
The mind-trip?  Before you create the mapping, change the target attribute back to the original value that you first believed was right.  It works.  The secret?  Occam's Razor gives us the best answer:  it's magic.




for details discussion visit the link below

http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/deaa3d55-3e04-4411-8450-80d35e03eb9b