Insert a Switch 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 Switch node is useful when you have to test for several different outcomes of a certain variable. A Switch node is meaningless without one or more subnodes. The subnodes must be added manually. There are two node types that you can add to a Switch node:
Note
This information applies only to Product builder.
Case node – Specifies case values that should be compared to the switch value.
Default node – Specifies that none of the case values are equal to the switch value.
Insert a switch node as follows:
Click Product information management > Common > Product builder > Product models.
Double-click a product model.
Click Product model.
Select the Tree tab in the lower pane.
Right-click the Modeling tree node.
Click New > Switch 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 in the Switch node form, describe what the Switch node does.
In the Switch value field, select the switch value that will be compared to the case values defined in the subnodes for the Switch node.
Click Test to test the code syntax.
Click OK to save the code.
To add one or more subnodes to the Switch node, right-click the Switch node and select New to add a Case node or Default node subnode.
Note
You can add multiple case nodes, but it is only necessary to add one or zero default nodes.
Define the actions that will be performed by each node and subnode until your Switch node is complete.