Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

To change the auto increment value while inserting a multi record at the same time.

Posted on by 22
In the above image the field S.No. use same no while inserting multi record at the sametime.
Categories:
  • Verified answer
    Tech-Lucky Profile Picture
    Tech-Lucky 794 on at
    To change the auto increment value while inserting a multi record at the same time.
    You can simply write this code on Table's on Insert Trigger  and change the Variables accordingly.
     
        trigger OnInsert()
        var
            CustomTable: Record CustomTable;
        begin
            CustomTable.Reset();
            CustomTable.SetCurrentKey(EntryNo);
            if CustomTable.FindLast() then
                EntryNo := CustomTable.EntryNo + 1
            else
                EntryNo := 1;
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 68,842 Super User 2024 Season 2 on at
    To change the auto increment value while inserting a multi record at the same time.
    Hi, is this a custom page?
    If you are customizing, you can refer to the Entries table, find the last line, and then add 1 for the entry no in your code.
    Or you can try AutoSplitKey Property.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • Aarthi Madhavan Profile Picture
    Aarthi Madhavan 22 on at
    To change the auto increment value while inserting a multi record at the same time.
    Hi Nitesh Bhoir I already set autoincrement  property on S.No. field
  • Suggested answer
    NB-26050925-0 Profile Picture
    NB-26050925-0 8 on at
    To change the auto increment value while inserting a multi record at the same time.
    You can set autoincrement property on S.No. field and try to insert record.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,353 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,251 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans