Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

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

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

    Hi Suresh,

    Thank you so much for helping me solve this issue!

    The result is great!

    You are truly a NAV Expert!

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

    Allen,

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

    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

  • Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

    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

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

    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
    Community Member Microsoft Employee on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

    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.

     

     

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Display External Document No. when select Posted Sales Invoice and click SendAsPDF

    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.

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