Subject: Inventory Control, Materials Management, Packing String
We manage the Item Master for our ERP system and have a Packing String for each item that contains the various UOM and their conversion rates.
e.g. (1_RL)(6_BX)(60_CS)
The Conversion Rate and UOM are separated by "_" and each one is encased in ().
I need to be able to locate the UOM in the Packing String, and return the conversion rate. I then use the conversion rate in a calculation later in the workflow.
e.g. if CS is contained in my pack string, I want the value of 60 to be returned. If BX is contained in the pack string, I want the value of 6 returned.
This is the script I used, to no avail:
IF CONTAINS ([PACKING STRING], "CS") THEN
REGEX_Replace([PACKING STRING], [SOURCE UOM], PadLeft([PACKING STRING], 2, "_"))
ELSE ""
ENDIF
"CS" is just an example, the actual field will be [SOURCE UOM] that contains a UOM.
Any direction, very much appreciated !