web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Auto-Numbering Account Entities on Import

(0) ShareShare
ReportReport
Posted on by

Is there a way to have auto-numbering for the Account entity while using the standard import tool? I currently have a plugin to do this, but as you can see from the code below, it gets VERY inefficient as the number of accounts increases. What it's basically doing is searching through all the accounts to find the maximum number and incrementing it by 1 - the problem is that it's searching through the entire list after every new account is added.

var maxNumber = 1;
foreach(var account in accounts)
{
   int j;
   if(int.TryParse(account.AccountNumber, out j))
   {
      if(maxNumber < j)
      {
         maxNumber = j;
      }
   }
}
Target.AccountNumber = (maxNumber + 1).ToString();
ArsOrganizationContext.SaveChanges();

I see that there are paid versions available but I was looking for non-paid solutions. Currently using Dynamics Online 2016 Update 1. 

*This post is locked for comments

I have the same question (0)
  • PS Profile Picture
    23,577 on at

    Which version of CRM you are using?

  • Verified answer
    PS Profile Picture
    23,577 on at

    Go to the following link and download the solution, install it in CRM and you are good to go: crm2015autonumber.codeplex.com

    Other important reads:

    community.dynamics.com/.../auto-numbering-through-real-time-workflows-no-customization-no-add-on

    survivingcrm.com/.../auto-numbering-workflows-real-time-vs-asynchronous

  • Community Member Profile Picture
    on at

    Trying to download the Counter in the codeplex link but not quite sure how to install/implement it. There are three folders, "PluginAssemblies", "WebResources", "Workflows". What do I do with these?

  • Suggested answer
    razdynamics Profile Picture
    17,308 User Group Leader on at

    Hi Brian, the zip is a solution file which you import into crm, I think you may have extracted it by mistake. If you have any issues I can send you my version of the autonumber solution.

    Best Wishes, Raz

  • Community Member Profile Picture
    on at

    Thank you for your tip Raz. I have installed the solution but there does not seem to be any documentation on how to use it. For example, I have an Account number attribute for my Account entity - I would like this to be autonumbered but I do not know how to configure this.

  • Community Member Profile Picture
    on at

    Figured it out. For those who would like to know, all you need to do is go to Settings -> Counter Configurations. From there, you create a new counter by indicating which entity, which field name, and then setting the parameters for the counter. Very straightforward.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans