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

  • Verified answer
    Community Member Profile Picture
    on at
    RE: How to validate field value in Sales Invoice Line ? Business Central ( CLOUD )

    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

  • Rcordova NW Profile Picture
    95 on at
    RE: How to validate field value in Sales Invoice Line ? Business Central ( CLOUD )

    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 ?

  • Community Member Profile Picture
    on at
    RE: How to validate field value in Sales Invoice Line ? Business Central ( CLOUD )

    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
    RE: How to validate field value in Sales Invoice Line ? Business Central ( CLOUD )

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

  • Community Member Profile Picture
    on at
    RE: How to validate field value in Sales Invoice Line ? Business Central ( CLOUD )

    You can add the checking OnAfterModify

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 313 Super User 2025 Season 1

#2
Mansi Soni Profile Picture

Mansi Soni 242

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 226 Most Valuable Professional

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans