Add Inventory Item Event for Purchase Orders  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Add Inventory Item Event for Purchase Orders

Postby nsbandara » Thu Sep 28, 2017 1:24 pm

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.
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

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

Postby Mike.Sheen » Thu Sep 28, 2017 2:22 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Add Inventory Item Event for Purchase Orders

Postby nsbandara » Thu Sep 28, 2017 3:40 pm

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 ?
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

Re: Add Inventory Item Event for Purchase Orders

Postby Mike.Sheen » Thu Sep 28, 2017 6:01 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron