I am trying to fire a piece of code from the OnInsert trigger of the Purchase Line for a Purchase Order. This is no problem from the Purchase Order subform when I create a new line. However, the customer requires the Sales Order - Requisition Worksheet - Purchase Order functionality. And when I create the Purchase Order using the Req Worksheet, the OnInsert doesn’t fire (well, my message doesn’t come up, anyway, and other things that are supposed to happen don’t). I’m using Attain 3.01B, Canadian. cheers,
By default, the triggers don’t fire for the INSERT/DELETE Actions. Personally, I don’t like this, but that would be for another discussion. This means that PurchLine.INSERT in code would not fire your trigger, it would have to be PurchLine.INSERT(TRUE). If you look through Navision, they tend not to put the parameter in most of their code. Specifically, that’s the case for the Requisition Worksheet. In short, you just have to change the Make Order Codeunit for the Req. Worksheet. Depending on what your trigger does, you might have to change other places where there is a PurchLine.INSERT as well. Chris.