Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Row number in sales line page

(1) ShareShare
ReportReport
Posted on by 16
How to get selected row number in sales line?  or selected row number in any list page ?
 
  • Judy Profile Picture
    Judy Microsoft Employee on at
    Row number in sales line page
    Hi, if your issue has resolved, please mark the helpful answers so that you can help others who have the same question on the community.
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,673 Super User 2024 Season 2 on at
    Row number in sales line page
    Hi, not sure if you want to get this line number in the code? Hopefully the information below can give you some tips.
    Dynamics 365 Business Central: How to get a filter for the selected records on any page (For example, ‘1..3|6’)
     
     
    Thanks.
    ZHU
  • CU29041409-0 Profile Picture
    CU29041409-0 35 on at
    Row number in sales line page
    In Microsoft Business Central, you can get the selected row number in a list page by using the GETRECORDID function. This function returns the unique identifier of the selected record in the list. You can then use this identifier to retrieve additional information or perform actions related to the selected record. Here's an example of how you can use GETRECORDID:RecRef.GETTABLEVIEW(Page::"YourPageName").GETRECORDID(); Replace "YourPageName" with the name of the page where you want to get the selected row number. This code will return the record ID of the selected row in the specified page.

     

  • gdrenteria Profile Picture
    gdrenteria 12,929 Most Valuable Professional on at
    Row number in sales line page
    Hi
    If you want the row numbers to be unique, do not change and are directly related to the row, I would tell you to create a field where you update the row number, and with each insertion you increment it.
    As you have indicated, the "line number" is created with large range numbers, because they allow new rows to be created in the middle.
    If you want to have visibility of the number of lines in a document, this could help you.
    BR
    GR
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,262 Super User 2024 Season 2 on at
    Row number in sales line page
    Hi @Sathiyamoorthy,
     
    try this :
                action("Get seq number")
                {
                    ApplicationArea = All;
    
                    trigger OnAction()
                    var
                        SalesLine: Record "Sales Line";
                        seq: Integer;
                    begin
                        SalesLine.SetRange("Document Type", Rec."Document Type");
                        SalesLine.SetRange("Document No.", Rec."Document No.");
                        SalesLine.SetRange("Line No.", 0, Rec."Line No.");
                        seq := SalesLine.count();
                        Message(Format(seq));
                    end;
                }
    Best regards,
    Mohamed Amine MAHMOUDI
  • Sathiyamoorthy Profile Picture
    Sathiyamoorthy 16 on at
    Row number in sales line page
    Line number having 10000,15000, 20000,30000,..........etc, I need line number like 1,2,3,4,5,....etc
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,262 Super User 2024 Season 2 on at
    Row number in sales line page
    Hi,
     
    I think you can use "Line No." fields in Sales Line Table.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Sathiyamoorthy Profile Picture
    Sathiyamoorthy 16 on at
    Row number in sales line page
    I want the row number 7 as highlighted below 
     
  • soma Profile Picture
    soma 24,408 on at
    Row number in sales line page
    Do you want to count the row number? or get the selected row line number?

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! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,379 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans