FOR loop (form) [AX 2012]

Updated: March 21, 2011

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Click Product information management > Common > Product builder > Product models. Double-click a product model and then click Product model. In the lower pane, right-click the Modeling tree node and then click New > FOR node.

Use this form to insert a FOR node into the modeling tree.


This information applies only to Product builder.


Make sure that the control variable makes the condition FALSE; otherwise, the FOR node (and therefore the entire configuration) will continue to run without stopping.

The following tables provide descriptions for the controls in this form.




Test the FOR loop code.




The description of the loop.


Set the control variable for the loop to the value it should have when the loop begins running. For example, if the control variable is called counter, the following line of code would initialize it to the value one:

counter  = 1


Specify an operation for updating the control variable. This operation will be carried out once for each iteration of the loop. For example, the step you specify could be to add one to the value of counter:

counter  =  counter  + 1


counter ++


Specify the state that the control variable should be in for the loop to continue running. The expression should normally be a logical condition, and when this condition is FALSE, running the loop ends.

Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).