I’m trying to create a custom field on Customer Order Line which returns the sum of total Available qty across multiple sites. We have parts in stock on multiple sites so the sales team would like to see, when raising an order on the ‘main’ sales site, if there is available stock on any of the other sites in the same company.
This works when running a query in PL/SQL ...
(select
sum(IFSapp.Inventory_Part_In_Stock_API.Get_Inventory_Quantity
(contract,part_no,configuration_id,'AVAILTRANSIT','NOT EXPIRED','NETTABLE','CONSIGNMENT','COMPANY OWNED', NULL,NULL,NULL,NULL,NULL,NULL,'PICKING','F','MANUFACTURING','PALLET','DEEP','BUFFER','DELIVERY','SHIPMENT',NULL,NULL,NULL,NULL,'TRUE','FALSE',NULL,'*'))
from inventory_part_in_stock IPIS
where ipis.CONTRACT IN ('ABC','ABD') AND
ipis.PROJECT_ID is null AND
IPIS.part_no = colc.part_no)
… but when adding as a custom field (even when only joining on part number - IPIS.part_no = :part_no) the field only returns the available qty in the site the Customer Order is raised on.
Not sure if that makes sense!
Any thoughts/suggestions/alternate approaches would be appreciated.
Thanks
Linda