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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Updating dates on Sales Orders

(0) ShareShare
ReportReport
Posted on by 44

Hi All,

When a sales order is created from a sales quote, I would like to have the document date updated to "Today's Date"


EG
If i create a sales quote on 12/12/22 and only converted it to a sales order on 12/29/22, i would like the document date to show 12/29/22


How do i go about doing this?

Thanks!

I have the same question (0)
  • Suggested answer
    S.Kawamura Profile Picture
    1,532 on at

    HI,

    Just type and overwrite document date. It's convinient to type "t" instead of typing the date of today.

    So far as I researched, no standard feature exist for such requirement..

    I hope this helps you.

    S.Kawamura

  • rajivsewsarran Profile Picture
    44 on at

    Hey thanks for your response,

    Unfortunately the client wants it automatically populate.

    Can't wrap my mind around how that code should be...

  • Suggested answer
    DAnny3211 Profile Picture
    11,417 Super User 2026 Season 1 on at

    hello

    you must ask your partner to develop a pesrosnalisation

    DAniele

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,165 Moderator on at

    The code to do this is pretty easy. There is an event you can subscribe to that trigges when a quote is made into a sales order. You can simple set the date to today in that event. I am adding some sample code.

    codeunit 55015 QuoteToSalesOrder
    {
    
     [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Quote to Order (Yes/No)", 'OnAfterSalesQuoteToOrderRun', '', false, false)]
     local procedure OnAfterSalesQuoteToOrderRun(var SalesHeader2: Record "Sales Header"; var SalesHeader: Record "Sales Header");
     begin
        SalesHeader.Validate("Document Date",Today);
        SalesHeader.Modify(true);
     end;
        
    }
    

  • rajivsewsarran Profile Picture
    44 on at

    Thanks! ill have a go and let you know how i get on!

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,165 Moderator on at
    [quote user="rajivsewsarran"]

    Thanks! ill have a go and let you know how i get on!

    [/quote]

    Good, let me know if you need more assistance with it.

  • rajivsewsarran Profile Picture
    44 on at

    Hi Inge,

    Thanks for your help.

    This is what i sued and it worked!

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Quote to Order", 'OnAfterCreateSalesHeader', '', true, true)]

       local procedure OnAfterCreateSalesHeader(var SalesOrderHeader: Record "Sales Header"; SalesHeader: Record "Sales Header")

       begin

           SalesOrderHeader.Validate("Document Date", Today);

           SalesOrderHeader.Modify();

       end;

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,926 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans