Create a Coded condition

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

Coded conditions are written in X++ code. In the Parameters field group, variables that can be used in the code are selected. The code is expected to return a Boolean operator. If the code returns TRUE, a configuration is invalid.

Note

This information applies only to Product builder.

  1. Click Product information management > Common > Product builder > Product models. Select a product model. On the Action Pane, click the Models tab. In the Modify group, click Open > Validation.

  2. In the lower pane, click the Condition tab.

  3. Press CTRL+N to create a new condition.

  4. In the Type field, select Code.

  5. In the Parameters field group, press CTRL+N to select the variable to use to create the condition.

  6. If the selected variable belongs to the array group, you can specify its index in the group in the Index field.

  7. In the Coded condition field group, write the X++ code.

  8. Click the Message tab to create a message that will appear if the condition is true. Select the language that you will write the message in, and then type the message text.