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...
Suggested Answer

AL code setting a date field on sales orders, but updating on a copy sales order

(0) ShareShare
ReportReport
Posted on by 10
I have an al code extension that sets a custom date field to /today/ on a sales order creation. However, if someone copies a sales order and copies the header, it overwrites that field with the date from the original order. Is there some way to keep that field from being copied, or is there a way to remove the /copy header/ from the copy selection screen? Any thoughts?
 
Kevin
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    98,345 Super User 2026 Season 1 on at
    Hi, which trigger did you add the code to?
    This code may also be executed when copying document, you can move it to trigger which has nothing to do with Copy Document.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • KJ-03062255-0 Profile Picture
    10 on at
    I added the code to the "OnAfterInsert" on the Sales Header table.

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,986 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,071 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 975 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans