CodeUnit 80 Sales-Post, few first lines
j.marselo
Member Posts: 102
OnRun(VAR Rec : Record "Sales Header")
IF PostingDateExists AND (ReplacePostingDate OR ("Posting Date" = 0D)) THEN BEGIN
"Posting Date" := PostingDate;
VALIDATE("Currency Code");
END;
IF PostingDateExists AND (ReplaceDocumentDate OR ("Document Date" = 0D)) THEN
VALIDATE("Document Date",PostingDate);
. . .
my darkness is, when and where those vars 'PostingDateExists' and 'ReplacePostingDate' assigned or called?
please help. thank you.
IF PostingDateExists AND (ReplacePostingDate OR ("Posting Date" = 0D)) THEN BEGIN
"Posting Date" := PostingDate;
VALIDATE("Currency Code");
END;
IF PostingDateExists AND (ReplaceDocumentDate OR ("Document Date" = 0D)) THEN
VALIDATE("Document Date",PostingDate);
. . .
my darkness is, when and where those vars 'PostingDateExists' and 'ReplacePostingDate' assigned or called?
please help. thank you.
0
Answers
-
Hi,
PostingDateExist is a function that is called as codeunit 80 is executed. It is not called from a different location. It is used to check if the user has rights to post using the Posting Date (see User Rights Setup) and to check if the Posting Date is allowed according to the G/L Setup.
ReplacePostingDate is set when you use Batch Invoicing or Combine Shipments. Check the Options Tab and Help from these Reports to see what it does.
Regards0 -
Maximus's answer is not accurate.
PostingDateExists is a Boolean variable in CU 80 not a function
It is set when the function SetPostingDate is called from a function external to CU 80.
As you can see SetPostingDate does not check any user rights.SetPostingDate(NewReplacePostingDate : Boolean;NewReplaceDocumentDate : Boolean;NewPostingDate : Date) PostingDateExists := TRUE; ReplacePostingDate := NewReplacePostingDate; ReplaceDocumentDate := NewReplaceDocumentDate; PostingDate := NewPostingDate;
SetPostingDate is usually called by the batch posting functionality
SetPostingDate allows you to set a consistent posting date and, if required, a consistent document date on a batch of orders during posting.
Steve0 -
Sorry, SPost29 is right. I confused the PostingAllowed with the PostingDateExists function. :oops:0
-
of course !!! batch posting routine!!! yeah ... i have overlooked it.
Thanx thanx thanx ... Maximus , Spost0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
