UDF aus Stücklistenpositionen

Daniel Ebi

Hallo,

wir haben ein Layout für die Stücklisten erstellt. Nun möchten wir noch ein benutzerdefiniertes Feld (UDF) der Stücklistenzeile drucken.

Im Objekt "ItemTree" stehen jedoch nur die UDF des Artikelstamms zur Verfügung.

Kann von Seiten CoreSuite hier schnell was geändert werden - oder bleibt mir nur die Möglichkeit über eine eigene Abfrage auf die benutzerdefinierten Felder der Stücklistenposition zuzugreifen?

Danke für die Hilfe.

CU

Daniel

Philipp Knecht

Hallo Daniel

Da es sich um einen zusammengesetzten Schlüssel handelt kann man nicht so einfach eine Query "dranhängen".

Es bleibt dir die Option LD.QueryData() oder die Query:

          SELECT Code,Qauntity AS Qty,Qauntity AS MainQty,0 AS SortExpr,0 AS Lvl, 'Y' AS IsTreeCode  INTO #Lvl00 FROM OITT WHERE Code = '[%TreeCode]'
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty,(T0.ChildNum+1) * 10000000000000000 + T1.SortExpr AS SortExpr,1 AS Lvl, CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl01 FROM ITT1 T0 INNER JOIN #Lvl00 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty ,(T0.ChildNum+1)* 100000000000000 + T1.SortExpr AS SortExpr,2 AS Lvl, CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl02 FROM ITT1 T0 INNER JOIN #Lvl01 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty,(T0.ChildNum+1) * 1000000000000 + T1.SortExpr AS SortExpr,3 AS Lvl,CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl03 FROM ITT1 T0 INNER JOIN #Lvl02 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty,(T0.ChildNum+1) * 10000000000 + T1.SortExpr AS SortExpr,4 AS Lvl,CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl04 FROM ITT1 T0 INNER JOIN #Lvl03 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty,(T0.ChildNum+1) * 100000000 + T1.SortExpr AS SortExpr,5 AS Lvl, CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl05 FROM ITT1 T0 INNER JOIN #Lvl04 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty,(T0.ChildNum+1) * 1000000 + T1.SortExpr AS SortExpr,6 AS Lvl, CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl06 FROM ITT1 T0 INNER JOIN #Lvl05 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty,(T0.ChildNum+1) * 10000 + T1.SortExpr AS SortExpr,7 AS Lvl,CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl07 FROM ITT1 T0 INNER JOIN #Lvl06 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty,(T0.ChildNum+1) * 100 + T1.SortExpr AS SortExpr,8 AS Lvl,CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl08 FROM ITT1 T0 INNER JOIN #Lvl07 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code
SELECT T0.Code,T0.Quantity AS Qty,CASE WHEN T2.Code IS NOT NULL THEN T1.MainQty * T0.Quantity ELSE T1.MainQty END AS MainQty,(T0.ChildNum+1) * 1 + T1.SortExpr AS SortExpr,9 AS Lvl,CASE WHEN T2.Code IS NULL THEN 'N' ELSE 'Y' END AS IsTreeCode INTO #Lvl09 FROM ITT1 T0 INNER JOIN #Lvl08 T1 ON T0.Father = T1.Code LEFT OUTER JOIN OITT T2 ON T0.Code = T2.Code

SELECT * INTO #Result FROM #Lvl00

UNION ALL SELECT * FROM #Lvl01
UNION ALL SELECT * FROM #Lvl02
UNION ALL SELECT * FROM #Lvl03
UNION ALL SELECT * FROM #Lvl04
UNION ALL SELECT * FROM #Lvl05
UNION ALL SELECT * FROM #Lvl06
UNION ALL SELECT * FROM #Lvl07
UNION ALL SELECT * FROM #Lvl08
UNION ALL SELECT * FROM #Lvl09
SELECT T0.*, T1.* FROM #Result T0 INNER JOIN OITM T1 ON T0.Code = T1.ItemCode ORDER BY SortExpr


selber zu ändern.

hth
0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post