Skip to main content
Business Central forum
Suggested answer

Trigger update Totals for Sales Quote from extension

editSubscribe (0) ShareShare
ReportReport
Posted on by 10

Hello

When we change value of Unit Price manually, it re-calculates totals section 

tote.JPG

What I'm trying to achieve is to trigger totals re-calculation from an extension. Unit price gets updated by 

Rec.Validate("Unit Price", NewPrice) but totals aren't re-calculated 

    [EventSubscriber(ObjectType::Table, Database::"Sales Line", 'OnAfterValidateEvent', 'Markup (LCY)', false, false)]
    local procedure OnMarkupLCYChanged(var Rec: Record "Sales Line")
      var 
         FieldNo: Integer;
    begin

       NewPrice := any number 
      
       Rec.Validate("Unit Price", NewPrice);
   
    end;

Categories:
Attachments
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 20,984 Super User on at
    RE: Trigger update Totals for Sales Quote from extension

    Hi,

    Please visit the Page ID 46 and check the below code as per image, you will understand how its calculating.

    pastedimage1654859681259v1.png

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,126 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,646 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans