I want to reset Line No. when line is deleted, how can I do that?
Can I use OnDelete trigger and how?
When I delete all records and want to create new, Line No. is not starting from 1. It starts from last number of deleted records.
IMHO, as described on the link above, you have 2 options:
1. Leave AutoIncrement field alone, not trying to change it manually in any way;
2. Change AutoIncrement Property to false, and manage this field manually.
Answers
Create function: Add this code to the last line of the OnInsert trigger of table:
not the best practice at all but sometimes we have to do something just nice for customer, aren`t we?
IMHO, as described on the link above, you have 2 options:
1. Leave AutoIncrement field alone, not trying to change it manually in any way;
2. Change AutoIncrement Property to false, and manage this field manually.