This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
|
|
|
|
|
|
|
This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In this post I would like to show how you can add all the lines of an sales order or even a selection of sales order lines by code to an existing load.
Selection of sales order lines
static void Job1(Args _args) { WHSLoadPlanningWorkbenchServerForm loadPlanningWorkbenchServerForm = new WHSLoadPlanningWorkbenchServerForm(); WHSInventTransSumDim whsInventTransSumDim; counter c = 0; WHSLoadTable whsLoadTable = whsLoadTable::find("USMF-000004"); void addLine(InventTransId _inventTransId) { c++; select whsInventTransSumDim where whsInventTransSumDim.InventTransId == _inventTransId; loadPlanningWorkbenchServerForm.createTmpLoadLinesSalesLines( false, whsInventTransSumDim, c); } // Initialize parameter from Load loadPlanningWorkbenchServerForm.parmLoadPaysFreight( whsLoadTable.LoadPaysFreight); // Add lines using inventTransId addLine('012512'); addLine('012513'); // Add lines to load loadPlanningWorkbenchServerForm.addLoadLines(whsLoadTable); }All sales order lines of an sales order
static void Job1(Args _args) { WHSLoadPlanningWorkbenchServerForm loadPlanningWorkbenchServerForm = new WHSLoadPlanningWorkbenchServerForm(); WHSInventTransSumDim whsInventTransSumDim; WHSLoadTable whsLoadTable = whsLoadTable::find("USMF-000004"); InventTransId inventTransId = "012512"; // Only one InventTransId must be selected, // loadPlanningWorkbenchServerForm processes all sales lines // with same Sales ID select whsInventTransSumDim where whsInventTransSumDim.InventTransId == inventTransId; loadPlanningWorkbenchServerForm.createTmpLoadLinesSalesLines( true, whsInventTransSumDim, 0); // Add lines to load loadPlanningWorkbenchServerForm.addLoadLines(whsLoadTable); }