If you want to personalize your products a little, or if you are more of a configure to order operation where every product that you ship out the door is tailored to your customers specifications and needs then you will probably want to take advantage of the Product Configurator that is built into Dynamics AX. This feature allows you to create a product with a number of different attributes, and rules that will allow Dynamics AX to build a custom BOM every time the product is ordered, and also tell you if the product is even possible to make.
In this walkthrough we will show how to:
- Create A Constraint Based Product Master
- Create a Product Configuration Model
- Add Configuration Attributes
- Group Related Attributes
- Add Conditional Display Options
- Add Constraints to your Configuration Model
- Configure a BOMS Based On Attributes
- Use Table Based Attribute Values
- Use Attributes To Simplify Rules
Creating a Constraint Based Product Master
The first step in creating a Product Configuration is to create a Product Master that is enabled for Constraint Based configuration.
In this example we will show how to create a Constraint Based Product Master.
How to do it…
To create a constraint based product master, follow these steps:
- Open the Released
Products form from the Common group within the Product information management area page. - Click on the Product button in the New group on the Product ribbon bar.
-
In the New Released product quick creation form, change the Product subtype field to Product master.
- Give your product master a Product number, Product name, and also a Search name.
-
In order to the product to have product variants based on the configurations, we need to select the Config
dimension group from the Product dimension group field. -
From the Configuration technology, select the Constraint-based configuration
value from the drop down list. - After filling in all of the other configurations that you want for the product, click on the OK button to complete the setup.
Creating a Product Configuration Model
Once you have a product to configure, it is time to create a Product Configuration Model. This is going to contain all of the rules and definitions that you will use to tell Dynamics AX how to build your new product BOM’s.
In this example we will show how to create a new Product Configuration Model.
How to do it…
To create a new product configuration model, follow these steps:
- Open the Product configuration models form from the Common group within the Product information management area page.
-
To create a new model, click on the Product configuration model button in the New group of the Model ribbon bar.
-
Give your new configuration model a Name, Description, and also specify a new Name for the Root component.
- When the Product configuration model has been created, we need to link it to our product so that it will know to use it. To do this, click on the Versions button in the Product model details group of the Models ribbon bar.
- Create a new version by clicking on the New menu button.
- Specify the Product number that you want to associate with this configuration and enter a From date and To date for the model.
-
Tip: by default the model to and from dates will default in as today. In the To date field type in 12/32/2154 which is the AX date that equals Never.
- Once you have created the version, click on the Approve button in the menu bar.
- When the Approval dialog box appears, select the Approved By user and click on the OK button.
- Finally, click on the Activate menu button in the menu bar to allow the configuration version to be used.
Adding Configuration Attributes
The way that the configurations are personalized are though Configuration Attributes which the user will update as they are building their product variation.
In this example we will show how to create attributes and associate them with your product configuration.
How to do it…
To add a configuration attribute, follow these steps:
-
The first step is to create any new types of attributes that you may be using in this model. To do this, open the Product configuration model maintenance form and expand the Attributes panel. From the Attributes menu bar, click on the Maintain attribute types menu button.
- In the Attribute types form, click on the New button in the menu bar to create a new attribute type, and give it a Name.
- Rather than having a free-text value that the user enters in, it’s sometimes better to give them a list of valid configuration values that they can use in the Attribute Type. To do this, check the Fixed list check box.
-
Then click the Add button in the Values panel menu bar to add the valid values.
Tip: In these examples, we create the first entry as None. This allows you to have a null value that represents that the user has not selected anything yet.
-
Repeat the last step for every one of the valid configurations that you allow for the Attribute type.
- When you have finished, click the Close button to return to the product configuration model.
- Once we have an attribute type, we will create the Attributes that we will be using to describe our product. To do this, click on the Add menu item in the Attributes panel.
- Give your attribute a Name which will be a friendly name for you.
- Give it a Solver name. This is the variable name that you will use to reference it later on in your configuration rules.
- Add a Description where you can add more detailed information about the attribute.
-
And then from the Attribute type drop down box, select the Attribute type that you just created which will be used as a template for this attribute.
-
Finally check the Set default value check box, and select one of the Attribute values from the Default value drop down box. We used the None value so that we will default it in as the unselected value.
How it works…
Now that we have configured an attribute, we can see it in action by clicking on the Test button in the Run group of the Model ribbon bar.
This will open up a configuration window, and we will see our attribute and be able to select form the drop down box the value that we want.
We can add more attributes exactly the same way. Note that in this example, we are creating six attributes that are similar, so we are reusing the same attribute type.
If we click the Test button again we will now see all of the other attributes that we created.
Grouping Related Attributes
If there are attributes that are related to each other then you may want to show them together in the configuration dialog box. To do this we need to change the way that they are displayed within the UI.
In this example we will show how you can group attributes together.
How to do it…
To group related attributes, follow these steps:
-
Open the Product configuration model maintenance form and click on the User interface button in the Product model details group of the Models ribbon bar.
-
This will open up the User interface maintenance form. You can move the attributes around just by selecting them and clicking on the Move up and Move down menu items. But if you want to nest them together to make them stand out, then click on the New attribute
group button in the menu bar. -
Give your attribute group a new name, and then click on the OK button.
- Now select the attribute that you want to move and select the group name from the Attribute
group drop down list. -
You can repeat this step for any other attributes you want to group.
- After you have created all of your groupings, just click on the Close button.
How it works…
Now that we have configured an attribute groups, we can see it in action by clicking on the Test button in the Run group of the Model ribbon bar. We will now see sections for each of the groupings that we created.
Adding Conditional Display Options
You may not want to show all of the attributes on the configuration screen initially. Some may be dependent on others being set, and others may have to be added sequentially so that you don’t have gaps in the configuration attributes. You can do this through the product configurators conditional rules that allow you to show and hide attributes based on conditions.
In this example we will show how you can create conditional display rules on your attributes.
How to do it…
To add conditional display options, follow these steps:
- Open the Product configuration model maintenance form and expand the Attributes panel. Select the Attribute that you want to add conditional display rules for.
- To hide the attribute, check the Hidden check box.
- To make the display conditional, add a rule in the Condition field.
-
Note: In this example, we are going to hide the Port2 attribute when the value in Port1 equals (==) “None”.
How it works…
To see it in action by clicking on the Test button in the Run group of the Model ribbon bar. Notice that the Port2 attribute is initially hidden.
When we select a value for the port then the Port2 attribute is displayed.
We can add more conditional rules on when to hide and display the attributes. When we test the configuration display now, we don’t see all of the other attributes initially. As we select the values, then only the new attribute options are shown.
Adding Constraints to your Configuration Model
You can further refine your Product configuration model by adding constraints. These are rules that allow you to restrict what values are allowed to be entered in the attributes based on the values of other attributes.
In this example we will show how you can add constraints to your configuration models.
How to do it…
To add constraints to your configuration model, follow these steps:
-
To create constraints, open the Product configuration model maintenance form and expand the Constraints panel. From the Constraints menu bar, click on the Add menu button.
-
When the new constraint dialog box is displayed, select the Expression constraint option from the Constraint drop down list. This will allow us to write a simple expression that defines what restrictions we are placing on the attribute.
- Give your constraint a Name, and Description.
-
In the Expression field we will now write our rule that will tell Dynamics AX what is valid and what isn’t, using the Implies
function. The format is:Implies[AttributeRuleIsImplied, WhenAttributeRuleIsTrue]
i.e. WhenAttributeRuleIsTrue (then) AttributeRuleIsImplied
Implies[Cable1 == "CT-AV1", Port1=="PT-AV"]
i.e. When Port1 is “AV” then Cable1 may be “CT-AV1″
-
Repeat the step and add as many constraints as you like.
How it works…
To see it in action by clicking on the Test button in the Run group of the Model ribbon bar. Notice that the attribute values that are not allowed are not checked, and also cannot be selected.
Configuring BOMS Based On Attributes
Once you have all of your attributes configured, with their values, and constraints, you can now create the rules that will allow Dynamics AX to use them to create dynamic BOM’s on the fly.
In this example we will show how to define the rules for your Product model BOM’s.
Getting Ready…
Before we start though, make sure that you have created all of your product masters that you are going to be using in the BOM’s that the Product configurator will be creating:
How to do it…
To configure a BOM based on attributes, follow these steps:
- To define the BOM creation rules, open the Product configuration model maintenance form and expand the BOM lines panel. From the menu bar, click on the Add menu button to create a new BOM line rule.
- Give your BOM line rule a unique Name and a Description.
-
If this BOM line is dependent on an attribute being a certain value then add the expression that you want to check in the Condition field.
- Once you have created the line, click on eth BOM details button in the BOM lines menu bar to open the BOM line designer.
-
In the BOM line details form, enter in the Item number that you want to use in the BOM line.
-
Then configure any of the BOM line fields that you want to use. In this example we set the Calculation, Quantity, and Unit fields.
-
Continue this for all of the other types of BOM lines that you want Dynamics AX to use.
Tip: after creating all of your rules, click on the Validate button in the Run group of the Models ribbon bar to check all of your conditions, and expressions. If there are any errors then it will notify you and you can debug your rules.
How it works…
To see this in action, you can create a new sales order and create a line on the order for the configured product that you just created. Open up the detail tabs at the bottom, and select the Products tab. Notice that there is no Sub-BOM value at this point.
From the Product and supply drop down menu in the Sales order lines panel, select the Configure line menu item.
This will open up the same configuration screen that you have seen during the testing of your product configuration. Fill in the attributes that you want to use for the product configuration, and click the OK button.
After you have finished, you will now see that Dynamics AX has created and assigned a Sub-BOM to your order line.
If you drill into the Sub-BOM you will see that it has created a new BOM, you will see the BOM lines that it has automatically built for you.
Additionally, from the Update line drop down menu in the Sales order lines panel, select the (Calculate) Based on BOM/Formula menu item.
This will open up the cost calculation form for quotation purposes. To calculate the cost of the product configuration, just click on the OK button. You will then be shown how much the configuration will cost to build based on the base components of the BOM allowing you to quote the expected price to the customer.
Using Table Based Attribute Values
You don’t have to hard code the attribute values as we have done in the previous examples. The Product configurator has the ability to look up the values directly from the database, allowing you to dynamically update attribute values.
In this example we will show how to create Attribute values based on live table data.
How to do it…
To use table based attribute values, follow these steps:
- To do this, open the Product configuration model maintenance form, expand the Attributes panel, and click on the Maintain table constraints button in the Attributes menu bar.
-
When the Table constraints maintenance form appears, click on the New button in the menu bar.
- This will start off the New table constraint wizard. Click Next through the introduction screen.
- Give your table constraint a Name, and Description, and then change the Type to System Defined.
-
This will allow you to then choose a table from the Select table drop down box.
- When you have finished, click the Next button.
- In the next wizard step, click on the Add button to add attribute values to our table constraint.
-
Select the fields that you want to pick from the table within Dynamics AX, and link them to the Attribute type.
-
Once you have defined your attributes, click on the Select query button to add a filter to the returned values.
- In the Select query, add a wildcard filter onto the table that you are querying, and then click on the OK button to return to the wizard, and then click the Next button to continue on.
- To complete the process, click on the Finish button on the wizard.
- Repeat this step for any other tables that you want to add constraints based on table data.
-
To use the Table constraints, create a new Constraint by clicking on the Add button in the Constraints menu bar.
-
Rather than using the Expression constraint
as we have done in the previous examples, this time change the Constraint to Table constraint, and click the Create button. - Give your new constraint
a Name, Description and then click the drop down button in the Table constraint definition field. - This will open up the Table constraint attachment form. In the Table constraint name field, select the attribute type that you want to override the drop down list on.
-
Then select the attribute that you want to use from the attribute tree and select the column that you want to use for its lookup from the Table constraint column dropdown box.
- When you have finished, click the Close button.
-
Repeat this process for any additional attributes that you want to link to the table constraints.
Tip: One thing that you may want to do though it to add additional dummy configuration fields into Dynamics AX for the null values. This will allow you to have the unselected option show up when the configuration screen is displayed.
How it works…
Now when you test the Product configuration model, the data that is listed against the attributes is being pulled from the database.
If we add a new record to the database that matches the selection criteria within the constraint, then it will automatically be shown in the configuration screen.
Using Attributes as Variables
Attributes do not have to be values that the user enters. They can also be used to store related information that you can then use within the constraints and rules of the Product configuration model. This allows you to simplify your models, and also makes them more flexible as well.
In this example we will show how you can use attributes as variables within your configuration model.
How to do it…
To use attributes as variables, follow these steps:
-
First, open the Product configuration model maintenance form, expand the Attributes panel, and click on the New button to create a new attribute.
Note: in this example we are creating an attribute for the ItemId that will be linked to the selections that are made within the other attributes. We didn’t bother setting a default value.
-
Check the Read only check box in the Modifiers group. This makes sure that the value is only changed by the system.
-
Then open up the Constraints panel, and select the Table constraint definition dropdown for the attribute that you want to link to the attribute.
-
In the Table constraint attachment form, add an additional column constraint, but this time, link the ItemId to the new attribute that we just created. This will populate the attribute with the corresponding Id linked to the NameAlias of the product.
How it works…
To see this in action click the Test button. Notice that the Attributes are already populated. When the attribute value is changed, then the other reference attribute changes as well.
As an example of how to use the attribute, we will use it to simplify the BOM lines rules. We will delete all but one of the lines for the associated attribute, change the Name, and Description, and then change the Condition to Port1 != (is not equal to) “None”.
Then click on the BOM line details button in the menu bar. If you notice on the right of the BOM line details there are radio boxes for Value and Attribute. Up until now we have just been hard coding values. If we change the selection to Attribute then we can select any of the attributes and use the current value in there as the value for that element. Select your reference attribute, and then click the OK button.
Now you will see that the Item number field is being populated from an attribute.
Tip: After you create the reference attribute, you may want to check the Hidden check box on the attribute so that it doesn’t show on the configuration form.
If you repeat this process on all of the other BOM lines that are configured based on the attribute values, then your BOM lines will look a lot tidier.
Tip: You may also want to update your User Interface configuration as well and group your variables with your display attributes… just to be tidy.
Now when you configure your order line, it will be built from the data within your product tables.
Summary
The Product Configurator that is built into Dynamics AX is a pretty useful tool, and if you spend the time creating the rules on how you should be building your products, it can possibly reduce the number of BOM’s that you define down to just a handful.