Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Cant get Document no from General Journal Lines

Posted on by Microsoft Employee

Hi everyone, I'm starting with navision and I have a question. I'm trying to create a simple page to print receipt, and I need to fill the "Document No" field with the "Document no" of my cash receipt journal with the name "GENÈRICO".

r6yhyhmumb95.png
kbap78d7hgd9.png

I cant figure how to do this, because I'm printing the "Document no" always empty or with "Não".. anyone can figure why?


5stjmtndwphs.png
pp1kbhdav9rw.png
My code:

OnOpenPage()

MESSAGE('%1',LastGenJnlLine."Document No.");

MESSAGE('%1',LastGenJnlLine.GET("Document No."));


Rec."Document No." := LastGenJnlLine."Document No.";

Where LastGenJnlLine is a global of type record, linked to "Gen Journal Line" table

*This post is locked for comments

  • Suggested answer
    nav.mukesh Profile Picture
    nav.mukesh 617 on at
    RE: Cant get Document no from General Journal Lines

     I think it should be -

    OnAfterGetRecord 

    MESSAGE('%1',Rec."Document No.");

    MESSAGE('%1',LastGenJnlLine.GET("Document No.")); is wrong for two reasons -

    1. Get function is used with Primary Key fields which means you should have Template Code, Batch Code and Line No. passed in Get

    2. If you use Get in message, this will return if it has retrieved the record from DB or not 

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans