Skip to main content

Notifications

Announcements

No record found.

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
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
  • AL code setting a date field on sales orders, but updating on a copy sales order
    I added the code to the "OnAfterInsert" on the Sales Header table.
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,848 Super User 2024 Season 2 on at
    AL code setting a date field on sales orders, but updating on a copy sales order
    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

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans