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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

(0) ShareShare
ReportReport
Posted on by 485

I am getting this error after trying to changing a field value if a condition is met. I am doing this in a report extension to try and change a column value to either '' or 'Paid' depending on if the Remaining Amount == 0.

Here is what I have in my report extension:

Screen-Shot-2022_2D00_05_2D00_16-at-5.42.33-PM.png

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi jdrco ,

    I see your code, there are bit changes you have to do, I also checked that you are trying to modify Sales Invoice header field in Report extension which system will not permit you to do that, Instead you have to find other way to accomplish you task. by the way there are bit changes in the code you have to do.

    head.get(yoursalesinvheader."No.");

    Head.calcfields("Remaining Amount");

    if head."Remaining Amount = 0 then

     head.paid := 'Paid'; // You can not modify Posted data.

    Thanks.

  • jdrco Profile Picture
    485 on at

    I see. Do you know of a way I can do this without using the .rdlc?

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

    Hi jdrco,

    Can you please elaborate your requirement more? I am not sure what you want to achieve

    Thanks.

  • jdrco Profile Picture
    485 on at

    Thanks for responding.

    Right now I am working on a report extension, and I want to add a column that changes depending on the value of "Remaining Amount" on the Invoice.

    I want this column field to display "Paid" when the "Remaining Amount" on the invoice is 0 and if it isn't 0 then just display an empty string on the report.

    I tried adding a custom field called 'PAID' using a table and page extension (extends the Sales Header and Sales Invoice), and modifying the value of the field using the method above (Head.Paid := 0). As you said, this won't be accepted by the system, so is there another way of doing this without using the .rdlc format layout? (Just AL programming)

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

    Hi jdrco ,

    Please follow the below steps.

    Declare global variable.

    pastedimage1652756770076v1.png

    Declare above variable as column in Head Data item

    pastedimage1652756832905v2.png

    Put the login on AfterGetrecord trigger

    pastedimage1652756890364v4.png

    After doing above changes, show this column as a text in the report and publish the app and then run the report.

  • jdrco Profile Picture
    485 on at

    Thank you this works. Do you know any good resources for AL programming? I am a bit new to the game.

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

    Just a quick question for future reference. What do I do with the "Identification fields and values" that are given in the error. Does that mean I have to include that in get()? Also what would I even put for "yoursalesinvheader" like you mentioned in this response?

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

    Hi,

    Whenever you get the error with the message "Identification fields and values", you will see that it also asking you put the values in that particular field, like in this message its "No.", so its a No. field's value you have provide of that "Sales Invoice Header" table.

    "YourSalesInvheader" means you have you put the No. field's value of the sales invoice header table.

    Thanks.

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 July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 520 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 384 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 363 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans