Missing inventory events  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Missing inventory events

Postby perry » Thu Jul 03, 2014 3:13 pm

Similar to Inventory.SOHCollection.ReadEnd

There is no warehouse summary ReadEnd and varies tabs under "Order" tab (like On Order, On BackOrder etc).
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15

Re: Missing inventory events

Postby Scott.Pearce » Thu Jul 03, 2014 3:40 pm

That is correct.

Some of the grids do not have underlying business logic as such, but rather, a stored procedure is fired which passes back to the grid an XML document that contains schema information and the actual display data. In this case, one would hook in to the UI tab click events, or customize the actual stored procedures (ie. if you wanted to add a column).

I do also see, however, that some of the grids *are* populated by underlying business logic objects, but the reads are "lazy" - this means that the BusinessLogicObject.SomeCollection.Read is only called when necessary, like when the user clicks on the tab that holds that particular data. Some of the BusinessLogicObject.SomeCollection.Read routines do not raise a "ReadEnd" event. In particular, I identified the following as lacking a "ReadEnd" event:

Inventory.OrderLevels.Read()
Inventory.SalesHistorys.Read()
Inventory.Budgets.Read()
Inventory.BOMUsages.Read()
Inventory.BOMFinishedGoods.Read()
Inventory.JobUsages.Read()
Inventory.JobFinishedGoods.Read()

I have logged these for correction via bug 10670. If you need assistance with the stored procedure driven grids, let me know. You can get an indication of whether a grid is stored procedure driven by looking at System Configuration->Inventory->StoredProcForXXXX values, or failing that, you can ask here.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Missing inventory events

Postby perry » Thu Jul 03, 2014 4:15 pm

Thanks for reply Scott, for the task I'm working on, I do need ReadEnd event for "Warehouse Summary" tab. I don't think there is a business object for it?

For this particular task, I need to append another summary column to the grid. I added the blank column ok but I dunno which event should I use to populate the data.

Is there any grid level events I can use? e.g. InventoryUI.grdWarehouseSummary.ActiveSheet.Changed
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15

Re: Missing inventory events  Topic is solved

Postby Scott.Pearce » Thu Jul 03, 2014 4:43 pm

It would be *far* easier to modify the stored procedure that drives the grid. And when I say modify, I mean take a copy, rename it, and change the system setting to point to your custom stored proc!

In the case of the Warehouse Summary tab/grid, I see in System Settings->System Configuration->Inventory that there is a setting called "WarehouseSummaryStoredProcedureName", and it's value is "usp_JIWA_Warehouse_SOH_Summary". So, follow these steps:

1. Make a copy of "usp_JIWA_Warehouse_SOH_Summary", and name the copy "usp_LONICERA_Warehouse_SOH_Summary". Don't forget to run "grant_all_user_tables" to give the correct permissions to Jiwa on your new stored proc.
2. Change the setting System Settings->System Configuration->Inventory->WarehouseSummaryStoredProcedureName so that it's value is "usp_LONICERA_Warehouse_SOH_Summary".
3. Now go back to the Inventory form (close and re-open it if it's already open), and ensure that the Warehouse Summary tab/grid still works.

Now it is time to make your actual code changes to the "usp_LONICERA_Warehouse_SOH_Summary" stored procedure. Looking at the stored procedure code, I see that it is not actually returning XML for grid construction/population - it's a bit of an ugly duckling in this regard. Nonetheless, I find that if I simply add a column to the "#tmpWarehouseSOH" temp table, populate the column, then spit it out as part of the final SELECT query of the stored procedure, my column appears on the Warehouse Summary grid! Too easy!! :-)
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Missing inventory events

Postby perry » Thu Jul 03, 2014 4:55 pm

Great!!

What do I need to do to get Totals for the new column?
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15

Re: Missing inventory events

Postby Scott.Pearce » Thu Jul 03, 2014 4:56 pm

Nothing. It's already taken care of ;-)
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Missing inventory events

Postby perry » Thu Jul 03, 2014 5:00 pm

ar...ok it wasn't showing the total if I dont declare the new column as Decimal(19,6).

all good now, thanks!
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron