Page 1 of 1

Alternate PartNo searching

PostPosted: Mon Sep 16, 2024 4:09 pm
by neil.interactit
Hi,

A client has a requirement to search on alternate part numbers. (Note this does not involve the Jiwa alternate part numbers). Specifically, they have a long established inventory custom field "Alternate Part", when a part number changes, they copy the existing partno to alternate part, then update partno.

The requirement is on SOE, when typing a partno directly into the grid (ie. without the lookup popup), if the partno exists - proceed as usual, if the partno does not exist - search altpart instead and if found substitute partno and proceed as usual.

All the altpart searching and partno substitution logic is fine.

I'm stuck on intercepting the current Jiwa SOE inventory search process.

At a BL level, I have tried AddInventoryItemStartEventHandler(InventorySeed, InventorySeedType, ref NewKey, KitHeader, LineNumber) but unfortunately InventorySeed is passed by value not by ref so I cannot alter it.

At a UI level I have tried GrdLines_LeaveCell / GrdLines_Change / GrdLines_KeyPress / GrdLines_KeyDown (intending to modify the partno text if needed), but the partno search either fires before or inhibits these.

Could you point me in the right direction to correctly intercept in order to add this functionality?

Cheers,
Neil

Re: Alternate PartNo searching  Topic is solved

PostPosted: Tue Sep 17, 2024 3:36 pm
by Scott.Pearce
What if you add your handler for GrdLines_Change in the SetupBeforeHandlers method?

Re: Alternate PartNo searching

PostPosted: Wed Sep 18, 2024 6:04 pm
by neil.interactit
Perfect!

Many thanks Scott.

Re: Alternate PartNo searching

PostPosted: Wed Sep 18, 2024 6:08 pm
by Mike.Sheen
If you don't know about this already, we created a brief guide to developing plugins which might be worth spending 10 minutes reading through - we even have a section specifically on SetupBeforHandlers : https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/76906497/Plugin+Development+Guidelines#SetupBeforeHandlers