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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Display External Document No. when select Posted Sales Invoice and click SendAsPDF

(0) ShareShare
ReportReport
Posted on by

Hello,

I am using NAV 2013 and I want to display "External Document No." when click SendAsPDF on Posted Sales Invoice Page.

I have added the "External Document No." to Report 206 Sales-Invoice and its layout.

It works when I select one Posted Sales invoice and click SendAsPDF. However, when I select multiple Posted Sales Invoices and click SendAsPDF, the "External Document No." doesn't change.

All PDF pages show the same "External Document No.". 

I would appreciate if some expert could help to solve this issue.

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,255 Super User 2026 Season 1 on at

    Did you store the document no. in a variable and added to the design? and in the FTC report what is your expression to get the document no. have you used any aggregate function like LAST or FIRST.

  • Community Member Profile Picture
    on at

    Hi Suresh,

    Thanks for your reply. I added a variable "ExternalDocNoText" to C/AL Global, Datatype:Text, Length 80.

    In Visual Studio, I created a Text Box and select Text Box Properties, and set the value

    =First(Fields!ExternalDocumentNo_SalesInvHdr.Value, "DataSet_Result")

    I didn't use any aggregate function.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,255 Super User 2026 Season 1 on at

    Don't use First, just use =Fields!ExternalDocumentNo_SalesInvHdr.Value, "DataSet_Result"

  • Community Member Profile Picture
    on at

    Hi Suresh,

    Thank you! But I tried and it didn't work.

    When use

    =Fields!ExternalDocumentNo_SalesInvHdr.Value, "DataSet_Result"

    An error message will come out when to save the report.

    Error Details:

    Error while validating RDL content;

    The Value experssion for the textrun

    "Textbox24.Paragraphs[0].TextRuns[0]' contains an error: [BC30205] End

    of statement expected.

     

    I also tried

    =Fields!ExternalDocumentNo_SalesInvHdr.Value

    The issue still exists.

     

     

  • Verified answer
    Suresh Kulla Profile Picture
    50,255 Super User 2026 Season 1 on at

    Allen,

    See the attached image, in the report design select the SalesInvoiceLineNoCaption textbox and right click for textbox properties, on the right on the visibility tab select the expression  in the show option and you will see the window with all the datafields as shown at the end add your external document no. and in the actual textbox where you wanted to display the External Document No. set the expression to =Code.GetData(57,1)

    Ext-Doc-No.png

  • Community Member Profile Picture
    on at

    Hi Suresh,

    I really appreciate your time! 

    I followed your instruction to check the expression list, and I found that there is no Cstr(Fields!ExternalDocumentNo_SalesInvHdr).

    I suppose I need to add it to the list.  However, after adding    

    + Chr(177) + Cstr(Fields!DocDateCaption.Value)       to the list, and an error message appeared when I saved it.

    Then I tried

    + Chr(177) + Cstr(Fields!DocDateCaption.Value)

    , 1)

    It still can not be saved. 

    8662.Error.PNG8662.Error.PNG

  • Community Member Profile Picture
    on at

    Sorry I made some mistakes.

    It's   

    + Chr(177) +Cstr(Fields!ExternalDocumentNo_SalesInvHdr.Values)

    When I added

    + Chr(177) +Cstr(Fields!ExternalDocumentNo_SalesInvHdr.Values)

    It can be saved, but when Click SaveAsPDF button on Posted Sales Invoice Page,

    an error came out.

    Error-2.PNG

  • Suresh Kulla Profile Picture
    50,255 Super User 2026 Season 1 on at

    I think you are using visibility expression for external document no. textbox remove that expression.

  • Community Member Profile Picture
    on at

    I am so sorry that I used the wrong expression.

    This time I select SalesInvoiceLineNoCaption textbox and right click for textbox properties.

    Click Visibility and "Show or hide based on an expression"

    But I didn't see any expression.

    Hiden-Expression.PNG

  • Suggested answer
    Suresh Kulla Profile Picture
    50,255 Super User 2026 Season 1 on at

    Allen,

    Send me a private message with the object, i will check.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans