web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

After changing buy-from vendor in a purchase quote, set the tax liable = true (default is false)

(0) ShareShare
ReportReport
Posted on by 130

Hi all,

We use purchase quotes for taxable purchases. In this case, most of the vendors in our system are non-taxable for purchase orders.

I would like to:

  • set a trigger after changing the buy-from vendor name 
  • this trigger should over-ride default vendor settings, and set purchaseheader.taxliable = true if it is a purchase quote

Appreciate your guidance and suggestions,

**RESOLVED** Incase if it is of help to anyone

codeunit 60002 c60002PurchaseHeaderTaxLiable
{
    [EventSubscriber(ObjectType::Page, Page::"Purchase Quote", 'OnAfterValidateEvent', 'Buy-from Vendor Name', false, false)]
    local procedure MyProcedure(var Rec: Record "Purchase Header")
    begin
        Rec."Tax Liable" := true;
        Rec."Tax Area Code" := 'CA';
        rec.Modify();
    end;
}

Thank you

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at
    RE: After changing buy-from vendor in a purchase quote, set the tax liable = true (default is false)

    You can try the below code.

    [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterCopyBuyFromVendorFieldsFromVendor', '', false, false)]

       local procedure OnAfterCopyBuyFromVendorFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; xPurchaseHeader: Record "Purchase Header");

       begin

           if PurchaseHeader."Document Type" = PurchaseHeader."Document Type"::Quote then

               PurchaseHeader."Tax Liable" := true;

       end;

  • SammySevens Profile Picture
    130 on at
    RE: After changing buy-from vendor in a purchase quote, set the tax liable = true (default is false)

    Another winner from Mohana, thank you again!!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans