Trigger on Purchase Line table

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.

Hi,
have you seen this?
Event Types - Business Central | Microsoft Docs

you could use these events to achieve what you need, maybe you could use

OnAfterInsertEvent(VAR Rec : Record; RunTrigger : Boolean)
  1. https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/triggers/devenv-onafterinsert-trigger

  2. www.kauffmann.nl/…/