Suppose we have the following Autonumber field created with
Seed value – 1000 and Format – {SEQNUM:4}

Now based on a certain requirement, we want to dynamically / programmatically update / reset the seed value.
For this, we can make use SetAutoNumberSeed Action
Below we can see the auto number set as 1007 on creating a new contact record.

Now to set it back to 1000 we can run the following code –

On executing the action, we can see the next contact record having autonumber field set as 1000.

Another example –

On updating the value to 888, and creating a new contact record

Sample code –
OrganizationRequest customActionRequest =
new OrganizationRequest("SetAutoNumberSeed");
// name of the entity
customActionRequest["EntityName"] = "contact";
// attribute's schema name
customActionRequest["AttributeName"] = "cr59f_myautonumber";
// the value we want to set
customActionRequest["Value"] = Convert.ToInt64(888);
OrganizationResponse customActionResponse =
svc.Execute(customActionRequest);
Check other posts –
https://powerobjects.com/tips-and-tricks/auto-number-d365-version-9/
Hope it helps..
3 thoughts on “How to – Use SetAutoNumberSeed Action to reset/update the seed for the Autonumber attribute – DataVerse (Dynamics 365 / CRM)”