Skip to content

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

@mjahlv

Description

@mjahlv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions