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.

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)