web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Access Header Info in requestpage

(0) ShareShare
ReportReport
Posted on by 25

Hello, I am trying to display a simple message to the user to double check their posting date if it's older than 2 days when printing the report.  I cannot seem to get access to the Posting Date from the Sales Header in order to do the date comparison.  I have tried many different ways, this is where my code currently stands.

                    field(PackSlip; PackSlip)
                    {
                        ApplicationArea = Basic, Suite;
                        Caption = 'Generate Packing Slip';
                        ToolTip = 'Generates a packing slip with no pricing or scheduled ship date.';
                        trigger OnValidate()
                        var
                            today: date;
                            date_lim: date;

                        begin
                            today := today();
                            date_lim := calcdate('-2D', today);

                            if PackSlip then begin
                                BlankShipDate_Enabled := True;
                                message('today '   format(today, 0, '//'));
                                message('date_lim '   format(date_lim, 0, '//'));
                                message('post date '   format(post_date, 0, '//'));
                                message('post date #2 '   format(SalesHeader."Posting Date", 0, '//'));

                                if SalesHeader."Posting Date" <= date_lim then
                                    message('Your Posting Date is older than 2 days, please ensure your Posting Date is set to date of shipment before printing!');
                            end
                            else begin
                                BlankShipDate_Enabled := False;
                                ShipDate_Enabled := False;
                                BlankShipDate := False;
                            end;
                        end;
                    }

I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 595 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 364 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 331 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans