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...
Suggested Answer

Sales Line: Show additional fields based on item No.

(0) ShareShare
ReportReport
Posted on by 40

Hi

Whenever i open a Sales Invoice, i want to display additional fields on the sales lines in the Sales Invoice Subform, based on the Item No. in the sales line.

How can i achieve this?
I have extended the Sales Invoice SubForm and tried something like this where the relevant fields have a "Visible = isVisible;" property:
unknown.png

Here, the Rec (the sales line) is always empty because the sales lines are not yet fetched, so i cant read the data and make changes based on those.
I want to read the sales lines whenever i open a sales invoice, and based on the No. i want a few more fields to be displayed.

Thanks in advance.

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi andreas@protektit.no ,

    You can move your code on Onaftergetrecord or OnafterInsert  trigger of sub page, and instead of True of False in Exit function take a global variable something like : globalvariable:boolean

    [InDataSet]

    globalvar : boolean;

    and use that globalvar to your field property like below.

    modify("No.")

           {

               Visible = globalvar;

           }

    Hope it will help you.

  • Suggested answer
    Dallefeld Profile Picture
    235 User Group Leader on at

    1. I don't feel that you should EVER hardcode like you've done here

    2. Why don't you just have the fields visible and they will only be populated for the desired No.values

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 569 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 375 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 228 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans