Search code examples
c#dynamics-crmdynamics-crm-onlinedynamics-365autonumber

Dynamics365 - adding a new auto-number field to an existing entity and fill its values


I need to add a new "auto-number" field to an entity in Dynamics365 CE.

Thanks to Jonas Rapp's excellent XrmToolbox "Auto Number Manager", adding the field and defining its look is a breeze.

My challenge is: I have 100'000+ existing rows in that entity - how can I update the existing rows with the correct auto-numbering values?

I have tried it - but even if I make the "auto-number" field "required", creating it doesn't fill the values for the existing rows. I would have hoped this would be done automagically - as with a "computed column" or a new "not null" column with a default value n SQL Server.

Any easy ways of doing this? Can I somehow updates those existing rows via a workflow, or via the REST API ?


Solution

  • You can develop some ETL job using Scribe or SSIS + Kingswaysoft to fetch all the records in order you want and generate the sequenced Autonumber to update them back.

    You can do with Power Automate flow as well.

    Alternatively Jonas trick should help you too.