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 :
Microsoft Dynamics NAV (Archived)

Cant get Document no from General Journal Lines

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    nav.mukesh Profile Picture
    619 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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans