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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Trigger on Purchase Line table

(0) ShareShare
ReportReport
Posted on by

Hi all,

I need to put a trigger on table PurchaseLine such that if a record/line item is inserted on Purchase order, the [Quantity (Base)]=Quantity. How do I achieve this in AL??. I don't want to do it in sql.

Kindly assist.

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    You can either use table extension and use the the trigger or

    use event subscriber and subscribe to the event.

  • Romryan Profile Picture
    on at

    Teddy Herryanto,

    I know most of table extension goes in hand with the page extension. Do I need to create a page extension here??. And which is the best trigger to use Oninsert or onmodify or onvalidate??.

  • Suggested answer
    THE Italian Profile Picture
    Microsoft Employee on at

    It depends what you would like to achieve.

    You have to find out the right spot where to subscribe your own based on what your private IP is meant for.

    If this is just a check before inserting the record then there is no need to create a page extension but a codeunit with a function that subscribe to the appropriate event published where you would like to trigger your own procedure.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 719 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 410 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 369 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans