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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Reset auto-number sequence number in CRM Online

(0) ShareShare
ReportReport
Posted on by

Is there a way to reset the auto-generated sequence numbers used to create unique IDs for quotes, accounts, etc.? The official word from Microsoft Dynamics CRM Support is that it cannot be done, and the only way to acquire a "clean slate" is to request an organization reset. For small organizations with a single provisioned environment, how are they to orchestrate a proper SDLC with stages for development, testing, staging, and production? It seems unfeasible to require these orgs to request an org refresh each time they have test data in a developed environment & need to move to production.

*This post is locked for comments

I have the same question (0)
  • ChrisHH Profile Picture
    on at
    RE: Reset auto-number sequence number in CRM Online

    With PowerAutomate and Datavers Connector there is a simple way to reset it to any value.

    Screenshot-2022_2D00_02_2D00_01-at-13.21.53.png

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: Reset auto-number sequence number in CRM Online

    Hi

    This is a one off script, you can run from a console app, or linqpad script if you are familiar with or you could even use the XrmToolBox Code now plugin and run this script from there

    Please see below as to how you can run this script using Code Now plugin on Xrm Tool Box

    ScreenClip-_5B00_90_5D00_.png

    4265.ScreenClip-_5B00_87_5D00_.png

    Clear the default code and paste the following

    1512.ScreenClip-_5B00_93_5D00_.png

    public static void CodeNow() { QueryExpression qe = new QueryExpression("organization") { ColumnSet = new ColumnSet(new string[] {"organizationid", "name", "currentkbnumber"}) }; EntityCollection orgs = Service.RetrieveMultiple(qe); if (orgs != null && orgs.Entities.Count == 1) { var org = orgs[0]; var organizationId = (Guid)org["organizationid"]; Entity entOrg = new Entity("organization", organizationId); entOrg["currentkbnumber"] = 1; // This is the value you will be resetting to Service.Update(entOrg); } }
    
    

    And then if you run, the script should execute and perform the update.

    If you have not used XrmToolBox before, please follow the links below

    https://www.youtube.com/watch?v=TSN2oVKnjM0

    You can download the XrmToolBox from : 

    https://xrmtoolbox.com

    And then install the Code Now plugin from Plugin Store

    ScreenClip-_5B00_90_5D00_.png

    7870.ScreenClip-_5B00_91_5D00_.png

  • SudhirPr Profile Picture
    49 on at
    RE: Reset auto-number sequence number in CRM Online

    Thanks for sharing the 'supported' way of doing this sequence reset. Can you also point out where exactly this code needs to be plugged & run ? Appreciate. Thanks!

  • Suggested answer
    Hayer Profile Picture
    804 on at
    RE: Reset auto-number sequence number in CRM Online

    I think I am late to the party but in case anyone still struggling to find an answer, here is the answer: http://hayercrm.blogspot.com/2016/02/how-to-reset-auto-numbering-in-dynamics.html 

  • ScottDurow Profile Picture
    21 on at
    RE: Reset auto-number sequence number in CRM Online

    Hi - the numbering is internal I've not seen anyway of resetting this number for Dynamics CRM Online.

    If you need a mechanism to reset you can use a third party solution such as advcrm2011autonumber.codeplex.com

    Hope this helps,

    Scott

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans