Page 1 of 1

Missing inventory events

PostPosted: Thu Jul 03, 2014 3:13 pm
by perry
Similar to Inventory.SOHCollection.ReadEnd

There is no warehouse summary ReadEnd and varies tabs under "Order" tab (like On Order, On BackOrder etc).

Re: Missing inventory events

PostPosted: Thu Jul 03, 2014 3:40 pm
by Scott.Pearce
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.

Re: Missing inventory events

PostPosted: Thu Jul 03, 2014 4:15 pm
by perry
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

Re: Missing inventory events  Topic is solved

PostPosted: Thu Jul 03, 2014 4:43 pm
by Scott.Pearce
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!! :-)

Re: Missing inventory events

PostPosted: Thu Jul 03, 2014 4:55 pm
by perry
Great!!

What do I need to do to get Totals for the new column?

Re: Missing inventory events

PostPosted: Thu Jul 03, 2014 4:56 pm
by Scott.Pearce
Nothing. It's already taken care of ;-)

Re: Missing inventory events

PostPosted: Thu Jul 03, 2014 5:00 pm
by perry
ar...ok it wasn't showing the total if I dont declare the new column as Decimal(19,6).

all good now, thanks!