I want to customize the filtering of inventory by cross reference along with other properties.
I have added two other cross reference items for a stock item like this.
And now I want to customize, inventory filter in any other forms by the Alternate Type's Alternate Id value.
Thank you!
There is no simple way to add search capabilities over Stock Item's Alternate IDs without a customization. Also, keep in mind that we are talking here about the one-to-many relationship between Stock Item and Alternate IDs, which makes it impossible to simply drop Alternate ID column into the Inventory ID selector as this will result in same Stock Item shown multiple times because of a necessary join with the Cross-Reference DAC.
The first thing you need to do is create a database-bound field for the InventoryItem DAC (make sure you create UsrAlternateIDs column in the InventoryItem database) table to concatenate all Alternate IDs of a Stock Item (notice Visibility set to PXUIVisibility.SelectorVisible on PXUIField - this is required to show Alternate IDs column inside the Inventory ID selector):
Next step is to override the Persist method in the InventoryItemMaint BLC extension to regenerate concatenated Alternate IDs every time the user makes changes in the Cross-Reference tab :
And finally, you should add UsrAlternateIDs in PXSelector FastFilterFields property:
Once these 3 steps are completed, the final result should look as follows:
To concatenate all currently existing Stock Item Alternative IDs in one step, you can implement a custom action on the Stock Items screen. You can remove the action after that.