rappen / AutoNumManager

XrmToolBox plugin to manage Auto Number attributes in Microsoft Dynamics 365
http://anm.xrmtoolbox.com
GNU General Public License v3.0
9 stars 7 forks source link

Auto Numbers are not Genereated sequentially #27

Closed mukathangadurai closed 4 years ago

mukathangadurai commented 4 years ago

Hi, We have configured Auto Number to Case Entity in the CASE-{DATETIMEUTC:ddMMyyyy}-{SEQNUM:4} format. we have noticed sometimes the sequence number is not generated in the sequential way instead it is jumping. Is there any specific setting we need to do make it work properly and also wanted to understand how this format will overwrite the existing system format, is there any plugin registered when we set the configuration. please let us know.

Example. Case 1 : CASE-22012020-0001 Case 2 : CASE-22012020-0002 Case 3 : CASE-22012020-0005 Case 4 : CASE-22012020-0006 Case 5 : CASE-22012020-0007 Case 6 : CASE-22012020-0008 Case 7 : CASE-22012020-0013 Case 8 : CASE-22012020-0014

rappen commented 4 years ago

Hi @mukathangadurai The Auto Number Manager tool for XrmToolBox does not do any magic behind the scenes, it just helps you compose the auto number format that is part of the platform. This means that if you see gaps in your sequences, I would guess records have been created and then deleted/deactivated for the missing numbers. If that is not the case, I would encourage you to open a support ticket with Microsoft to report the problem: https://admin.powerplatform.microsoft.com/support

The ANM tool does not have any plugin or similar to overwrite the OOB formats, the SDK messages used to set the number format property does just that for us.

mukathangadurai commented 4 years ago

Dear @rappen Thank you for your response, we have raised the Microsoft ticket, however i have one more clarification on this, what will happen if case number reaches CASE-22012020-9999 . then the next case will be reset to CASE-22012020-0001 or it will fail. please let me know.

rappen commented 4 years ago

Hi, next number would be CASE-22012020-10000. The "4" in {SEQNUM:4} only defines minimum "length" of the number. See docs: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/create-auto-number-attributes#string-length

mukathangadurai commented 4 years ago

Dear @rappen As per your suggestion we have raised a ticket with Microsoft and they are saying it is not a issue with the product and they asking us to get the support from you. could you please advice us.

rappen commented 4 years ago

That's what I would say if I were MS too 😉 It is a fact that the Auto Number Manager has exactly nothing to do with how the sequential numbers are generated. How could it? The auto numbering feature that my tool is configuring is at the core of the platform, it is based on the SQL Sequence functionality. The tool is only using the APIs exposed by the CDS platform to define how the number should be formatted, 100% according to the docs https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/create-auto-number-attributes

The tool has a feature to update the seed of the sequence, which could create gaps in the sequence if someone deliberately change it, but the seed is only updated when someone manually clicks the button in the tool to update it.

If you (or Microsoft) are still afraid my tool is causing this, you can use the platform UI to set auto number format on the attributes instead. That works almost as well as the ANM tool.

mukathangadurai commented 4 years ago

Dear @rappen, Microsoft refused to take this is issue stating Xrmtoolbox is not Microsoft tool. Now we are planning to write a plug in on our own, so could you please guide us how to disable the auto number sequence which we configured through Xrmtoolbox.

rappen commented 4 years ago

Okay, the support rep obviously does not know ANM is just using MS platform SDK. MS even recommends using ANM in their documentation! See: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/create-auto-number-attributes#auto-number-manager

As mentioned, the auto numbering feature is not something I invented, it is a platform capability. So I don't understand why you would create yet another tool to do it.

There is also platform support in their UI for managing the auto number formats since a year or so.

It is not possible to disable numbering on an attribute where you have a number format specified, if you don't want it to apply auto numbering anymore you simply remove the auto number format. This can be done in ANM or using the platform capability in the Maker Portal, see this screen cast where I show exactly how to remove the numbering format if you don't know how to use the admin UI for Dynamics 365: https://www.screencast.com/t/4mlYQ0StFua

rappen commented 4 years ago

Closing this issue since I have not heard anything in 3 months. Feel free to reopen if necessary.