SuiteQL query to fetch the pick tasks associated with a specific wave record

The SuiteQL query given below is designed to retrieve pick tasks associated with a specific wave record. This query returns all lines within the pick tasks (for multi-order or bulk picking types) and provides the precise pick quantity for each line, rather than the cumulative quantity for an item/pick task.

SELECT
	pickTask.name AS NAME,
	PickAction_SUB.tranid AS docnum,
	PickAction_SUB.reference AS REFERENCE,
	BUILTIN.DF (PickAction_SUB.shippingaddress) AS shippingaddress,
	BUILTIN.DF (pickTask.item) AS itemname,
	item.displayname AS displayname,
	PickAction_SUB.quantity AS quantity,
	pickTask.recommendedBin AS recommendedBin
FROM
	pickTask,
	item,
	(
		SELECT
			PickAction.picktask AS picktask,
			PickAction.picktask AS picktask_join,
			"TRANSACTION".tranid AS tranid,
			"TRANSACTION".otherrefnum AS REFERENCE,
			"TRANSACTION".shippingaddress AS shippingaddress,
			PickAction.quantity AS quantity
		FROM
			PickAction,
			"TRANSACTION"
		WHERE
			PickAction.ordernumber = "TRANSACTION"."ID" (+)
	) PickAction_SUB
WHERE
	(
		(
			pickTask.item = item."ID" (+)
			AND pickTask."ID" = PickAction_SUB.picktask (+)
		)
	)
	AND pickTask.wave IN ('${waveId}')
ORDER BY
	doc

The waveId parameter can represent either a single value or multiple wave IDs.

Leave a comment

Your email address will not be published. Required fields are marked *