Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

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

(0) ShareShare
ReportReport
Posted on by 22
In the above image the field S.No. use same no while inserting multi record at the sametime.
  • Verified answer
    Tech-Lucky Profile Picture
    Tech-Lucky 815 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 76,221 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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,904 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,605 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans