2
votes

I'm writing a CRM 2011 plugin which needs to create a custom number for each new entity. My idea is to add a custom table (whithout any relation to other tables) to the CRM 2011 database which I can use to store/read/change my custom number.

Is this a good way to store custom information in database or shouldn't I use the CRM 2011 database for that? I can't use external databases because of the CRM online sandbox limitations...

thanks Tobi

2
What's the Custom Number for?Daryl

2 Answers

2
votes

It's not supported to make changes to the CRM 2011 SQL database.

Instead you can create a custom entity inside CRM 2011 with two fields:

  • Entity Name
  • Number

so the records will look like as

account | 23
contact | 112

and you can use the CRM 2011 Web Services to manage these values, in this way all your code is supported and works also with CRM Online.

1
votes

In terms of adding a table to the database I'm going to assume you mean, 'I will create a new entity in CRM and CRM will then create a table in the database for me'. As creating a table directly in the database is unsupported (and not possible in CRM Online in any case).

Creating an entity to store 'settings' information is perfectly acceptable and is practised by myself and many other CRM consultants.

It sounds like you are implementing some sort of auto number tool, so a quick word of warning. In CRM this is inherently tricky because there is no easy locking, e.g. if two records generate at the same time they can both end up with the same number.

I would suggest having a read of this, which suggests a method for locking effectively.

Implementing Robust Microsoft Dynamics CRM 2011 Auto-Numbering Using Transactions