cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ElyasAhmed
Frequent Visitor

Add serial autonumber even after existing record is deleted

I have an entity "Questions" in which there is an S.no Column. I used the auto number attribute to assign a value to the S.no column in this format: "QNo" + number with seed value 1000. I have 14 questions in the table(the 14th column has a value QNo1013). After creating a question in the form and deleting it, when I'm trying to create a new question I am getting a value of QNo1015 instead of QNo1014. Is there any way to retain the order of the column values in the auto number variable?

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User II
Super User II

@ElyasAhmed 

Autonumber its following a cardinal rule that a primary key is not reused once it is deleted. It makes sense when the key is used to connect to another table to establish a relationship. That being said, there are ways to fill in missing numbers using Sequence() or First(Sort(datasource, number, Descending)).number+1

View solution in original post

2 REPLIES 2
Drrickryp
Super User II
Super User II

@ElyasAhmed 

Autonumber its following a cardinal rule that a primary key is not reused once it is deleted. It makes sense when the key is used to connect to another table to establish a relationship. That being said, there are ways to fill in missing numbers using Sequence() or First(Sort(datasource, number, Descending)).number+1

View solution in original post

Thanks a lot @Drrickryp !!

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (63,613)