web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 481

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,698 Moderator on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

    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
    481 on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

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

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

    Hi jdrco,

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

    Thanks.

  • jdrco Profile Picture
    481 on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

    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,698 Moderator on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

    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
    481 on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

    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,698 Moderator on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

    You can try to complete these short course 

    https://docs.microsoft.com/en-us/learn/modules/intro-basics-al-programming/

    docs.microsoft.com/.../devenv-programming-in-al

  • jdrco Profile Picture
    481 on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

    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,698 Moderator on at
    RE: ERROR: The Sales Invoice Header does not exist. Identification fields and values: No.=''

    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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,921

#2
YUN ZHU Profile Picture

YUN ZHU 2,012 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,999 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans