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".
I cant figure how to do this, because I'm printing the "Document no" always empty or with "Não".. anyone can figure why?
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)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