Page 1 of 1

Add Inventory Item Event for Purchase Orders

PostPosted: Thu Sep 28, 2017 1:24 pm
by nsbandara
Hi,

I'm working on a plugin that displays a pop up message stored in inventory item notes in Sales orders, sales quotes, purchase orders and service manager job only for new transactions. For sales orders and sales quotes Jiwa fires an event when adding an inventory item to line collection.

Code: Select all
public event AddInventoryItemEndEventHandler AddInventoryItemEnd;


Is there a similar event for purchase orders and service manager jobs, that fires when adding inventory items ? If not is there a work around to detect user adding inventory item to purchase order using inventory search dialog

Thanks.

Re: Add Inventory Item Event for Purchase Orders  Topic is solved

PostPosted: Thu Sep 28, 2017 2:22 pm
by Mike.Sheen
All collection types will raise an Added event.

So, in the case of Purchase Orders, the Lines property will raise an Added event whenever a line is added to the purchase order - so you can add a handler for that.

We added the AddInventoryItemEnd event to sales orders because other magical and special things happen AFTER the line added event (such as adding kit component items), so that event was added to given observers an event which is raised when the business logic is truly finished adding the item.

Purchase orders doesn't have such complexities, so the .Lines.Added event should work for you - and the same with service job parts and things.

Re: Add Inventory Item Event for Purchase Orders

PostPosted: Thu Sep 28, 2017 3:40 pm
by nsbandara
Thanks Mike.

I assumed that lines added event would be raised when existing purchase order lines read and added to purchase order lines collection. Just realized its not.

Is there a documentation available other than https://help.jiwa.com.au/Jiwa7/7.00.175 ... Index.html for plugin developers ?

Re: Add Inventory Item Event for Purchase Orders

PostPosted: Thu Sep 28, 2017 6:01 pm
by Mike.Sheen
nsbandara wrote:I assumed that lines added event would be raised when existing purchase order lines read and added to purchase order lines collection. Just realized its not.


That's correct - we don't raise added events when reading a collection such as with purchase order lines. You should capture the purchase order ReadEnd event to handle that scenario instead.

nsbandara wrote:Is there a documentation available other than https://help.jiwa.com.au/Jiwa7/7.00.175 ... Index.html for plugin developers ?


I'm afraid not.