Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Can anyone help me How to give different no while inserting a record using Insert() function.

Posted on by 22
 In this image the field No. were repeat the same I need to change this no as P0171 and the next no as P0172 .
Categories:
  • Suggested answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,201 Moderator on at
    Can anyone help me How to give different no while inserting a record using Insert() function.
    Hi Aarthi Madhavan,

    If you are inserting records through code, you need to select the number series through code to automatically obtain the next number... you can do this as follows..
     
        var
            NoMgmt: Codeunit NoSeriesManagement;
        begin
            Rec."No." := NoMgmt.GetNextNo('NoSeriesCode', WorkDate(), true);
        end;
     
    If the page is a subpage and the data depends on the header record, as we have with sales and purchase order lines, you should select another record just select the subpage records..
     
    I hope this helps.
     
    Regards,
    Govinda Kumar
     
  • Suggested answer
    Deekshitha Reddy Profile Picture
    Deekshitha Reddy 219 on at
    Can anyone help me How to give different no while inserting a record using Insert() function.
    No. Series can be used to achieve this.
     
     
    Hope this helps.
  • Kamal Khakhkhar Profile Picture
    Kamal Khakhkhar 242 on at
    Can anyone help me How to give different no while inserting a record using Insert() function.
    Hii everyone,
    As per screen shot the record is created from a single order . Like purchase order. The line is contained the fields of header . So if you need to differentiate the record you need to create separately or need to customise the tables.
     
    Thank you,
    Kamal Khakhkhar 

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

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,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans