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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to validate field value in Sales Invoice Line ? Business Central ( CLOUD )

(0) ShareShare
ReportReport
Posted on by 95

Hi ,

I need validate a field in Sales Invoice Line . 

How can  get the value of a field line by line and check that it is not empty ?

Thanks

I have the same question (0)
  • Community Member Profile Picture
    on at

    You can add the checking OnAfterModify

  • Rcordova NW Profile Picture
    95 on at

    But how to make the loop to check line by line specific field?

  • Community Member Profile Picture
    on at

    You can use findset to loop the record and check the field

    docs.microsoft.com/.../record-findset-method

  • Rcordova NW Profile Picture
    95 on at

    SalesLine: Record "Sales Line";

    CurrPage.SalesLines.Page.GetRecord(SalesLine);

                       if SalesLine.FindSet then

                           repeat

                               Message(SalesLine.Description);

                           until SalesLine.Next = 0;

    im do this but i have only 2 lines in subform and show a lot of Message , how to take only my 2 lines ?

  • Verified answer
    Community Member Profile Picture
    on at

    add setrange("Document Type",....) and setrange("Document No.",......) to only loop the record you want.

    docs.microsoft.com/.../devenv-setcurrentkey-setrange-setfilter-getrangemin-and-getrangemax-methods

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans