Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-number seed setting logic should check the current highest value #52

Open
mjahlv opened this issue Apr 15, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@mjahlv
Copy link
Contributor

mjahlv commented Apr 15, 2021

Is your feature request related to a problem? Please describe

Currently when a seed value is changed there is no check to see if the new seed value is lower than the old seed value. Because auto-number attributes do not enforce unique values, this runs the risk of duplicate values if an auto-number seed is set lower than the previous value.

Describe the solution you'd like

  • Logic that checks if the desired seed value is lower than what is in the current environment and prevents the seed being set and outputs a warning/error to the log file.
    • This will require a query for the last created record that uses the auto-number attribute
  • An optional boolean parameter for the ImportConfig.xml called forceseedsetting that can be used to override the logic
    • Information should be logged to indicate when the seed has been set because of an override
  • Tests to validate the logic and that the values have not been changed in the target environment unless the forceseedsetting parameter is provided.

Additional context

The auto-number manager tool from XRM Toolbox has logic that can query and parse the current auto-number value: https://github.com/rappen/AutoNumManager/blob/16a19098465a454f98db28b96316f538497ca1cd/AutoNumMgr.cs#L479

@mjahlv mjahlv added the enhancement New feature or request label Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant