on 2024 Apr 08 3:58 AM
When the quantity of the parent item is changed, I would like to change the quantity of the component items accordingly. I have created a query to see if I can do it in FMS but it doesn't work. Please let me know if there is a good solution.
SELECT $[$38.11.NUMBER] * X.[ParentQTY] FROM( SELECT $[$38.11.NUMBER] * T0.[Qauntity] AS "ParentQTY" , T0.[Code] , T0.[TreeType] FROM OITT T0 WHERE T0.[TreeType] = 'T' AND $[$38.1.0] = T0.[Code] ) X INNER JOIN ITT1 T1 ON T1.[Father] = X.[Code] WHERE $[$38.1.0] = T1.[Code]
Request clarification before answering.
Solved
1. Create a UDF in document header.
2. Set FMS in quantity in detail tab
3. Enter parent item qty in the UDF
Query for FMS
SELECT
CASE WHEN T1.[Code] IS NULL THEN $[OPOR.U_ParentQty]
ELSE T1.[Quantity]*$[OPOR.U_ParentQty] END
FROM OITM T0
LEFT JOIN ITT1 T1 ON T0.[ItemCode] = T1.[Code]
WHERE $[$38.1.0] = T0.[ItemCode]
Hope it will help someone faced same issue~
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
13 | |
10 | |
5 | |
4 | |
4 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.