web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to have by default few fields copied from the previous line while creating a new line item

(0) ShareShare
ReportReport
Posted on by 54

Hello!

I am trying to customize the Lines in Sales order and want to have a field value automatically populated as the previous line when I create a new Line in Lines page.

Any solutions? Thank you in advance.

  • Verified answer
    DAnny3211 Profile Picture
    11,423 Super User 2026 Season 1 on at

    hi

    try this

    [EventSubscriber(ObjectType::Table, 37, 'OnAfterInsertEvent', '', false, false)]

       local procedure SetYpurField(var Rec: Record "Sales Line")

       var

           SalesLine: record "Sales Line";

       begin

           SalesLine.Reset();

           SalesLine.SetRange("Document Type",rec."Document Type");

           SalesLine.SetRange("Document No.",rec."Document No.");

           SalesLine.SetFilter("Line No.",'<>%1',Rec."Line No.");

           if SalesLine.FindFirst() then

           begin

               rec.YOURFIELD:=SalesLine.YOURFIELD

               rec.Modify();

           end;

       end;

    check my answer if it helped you, thanks

    DAniele

  • UserRecord Profile Picture
    54 on at

    With a few Modifications this works. Thank you.

  • Suggested answer
    Manan_Shah Profile Picture
    1,461 on at

    Hi Bismeet.

    In Base there is 1 more functionality I think that you can use.

    Search for Item Template. On this you get all similar field which are on Item card. 



    pastedimage1671000103701v3.png

    pastedimage1671000125355v4.png

    What are the values you fill on this. it will flow on While creating a new Item. 

    Now click on New on Item Card it will ask for choose Item Template if you create multiple. Select the Item template and it will fill all the values on new Item card from Item template. 

    pastedimage1671000262397v5.png

    Hope this will help. 

    Many Thanks,
    Manan

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 755 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 413 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 387 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans