Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

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

Posted on by 479

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

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 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.

  • jdrco Profile Picture
    jdrco 479 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
    Nitin Verma 21,091 Super User 2024 Season 1 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
    jdrco 479 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
    Nitin Verma 21,091 Super User 2024 Season 1 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
    jdrco 479 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
    Nitin Verma 21,091 Super User 2024 Season 1 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
    jdrco 479 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
    Nitin Verma 21,091 Super User 2024 Season 1 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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans