3/7/11

CRM 2011 First Steps - AutoNumber

Last week someone asked me if the CRM 2011 already contains a support for AutoNumber.

Background:
AutoNumber is the basic method to give unique number to a record in DB, when a record saved in DB we can add to a record a unique number usually the new number will be bigger from the previous, in SQL this operation called auto increment and automatically done by the DB.

After a quick scanning the new SDK I found that in CRM 2011 there is no out of the box support for the autonumber just like in CRM 4.0, however CRM 2011 supports autonumber just for a few entities as the picture display.

So the solution is the same just like in CRM 4.0, create a plugin register it on 'pre' operation for all entities, create a new custom entity, you can call it 'autonumber' and save there the max last number, every time when a plugin executes add one number and save it.


1 comment:

  1. איפה הקפתור Like?

    חח... תתחדש על הבלוג.

    ReplyDelete