Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Trigger update Totals for Sales Quote from extension

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:
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 20,991 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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans