Skip to main content

Notifications

Announcements

No record found.

Business Central forum

Modify field before approval

Posted on by 34
hi~~
I want to insert field before Send Approval Request but I have some error.
I hope SalesHeader.mark change into true mo matter action is success or fail. ( when i Send Approval Request then SalesHeader.mark change into true)
When action fail is important. ( mean 'No approval workflow for this record type is enabled.' the SalesHeader.mark change into true.)
I want to SalesHeader.mark := true; (default is false)
 
my code 
method1
method 2
When I do 
SalesHeader.Insert(true);
 
have error message The record in table Sales Header already exists. Identification fields and values: Document Type='Invoice',No.='S-INV******'
 
 
---------------------------------------------------------
update 
SalesHeader.Insert(true) become SalesHeader.Modify() but not modify the field.
 
Thanks a lot!!
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 68,757 Super User 2024 Season 2 on at
    Modify field before approval
    Hi, this code is in the Card page, it doesn’t need to be that complicated.
    For example,
     
    Hope this helps.
    Thanks.
    ZHU

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,349 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,212 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans