Insert a FOR node
Important
This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
The FOR node repeats a set of actions until a specific condition becomes false. A control structure of this kind is frequently called a loop.
Note
This information applies only to Product builder.
Click Product information management > Common > Product builder > Product models.
Double-click a product model. From the Product models form, click the Product model button.
In the lower pane, right-click the Modeling tree node. Select New and then select FOR node.
A new node is added to the bottom of the modeling tree. To insert a node into a particular position in the tree, drag it from the node list displayed on the left.
In the Description field, enter a description to describe what the FOR loop does.
In the Initialization field, the control variable for the loop is initialized to its value when loop execution starts.
The control variable must be one of the variables defined for the current product model. For example, if the name for the control variable is Counter, the initialization could consist in making the counter equal to the value 1: Counter = 1.
In the Step field, specify an action that should be performed on the control variable one time for each loop iteration. The action could consist of adding 1 to the value of the control variable: Counter = counter + 1.
In the Expression field, specify—in the form of a logical condition—the state required for the control variable so that the loop will continue to run.
The condition might be that the control variable should be less than or equal to another variable, such as: Counter <= number_of_doors. Make sure that the control variable does, in fact, make the condition false at some point. Otherwise, the FOR node, and therefore the whole product configuration, will continue to run interminably.