Introduction
In ax, the product model is used to determine the options available in the product configuration form and the computing to be executed during product configuration.
This chapter describes how to create a model, including
1. Local rules
2. Add variables and variable groups
3. Generate the item number and (or) dimension ID
4. Price combination
5. Graphics
The product model is the core of the product generator. It enables product configuration and determines the configuration process.
Product Model
The creation of product models is exactly the same as that of standard BOM and process routes.
You can use the Product Model Wizard when creating a product model. The operation path is as follows:
Choose product builder> product model> Settings> options and use the wizard when you create the product model. A wizard for the product model appears each time you create the product model, if this option is removed, no wizard prompt is displayed.
Different from BOM and process routes, the product model needs to be re-compiled every time the product model is modified. The operation path is as follows:
Product builder> product model> function> compile Product Model
Only when the product model corresponds Code The product model can be used only when the green check mark is displayed for both the SAVE and the rule check. If either of them is a Red Cross, an error message is displayed when the product model is used.
As shown in, the modeling variable card can add modeling variables to the product model. System, simple, data type, table, class, and other tab product model calculation type variables can be added to it.
In the following section, the tree consists of various types of nodes that are used to process calculation variables and Operations corresponding to specific variable values, BOM , Routing, messages, and others. You can see the corresponding X ++ Code that can be directly modified X ++ Code.
Variable Group
In the upper part of the table, there is a variable group. You can put a variable of the product model into the group, so that a model variable can be allocated to different groups. On the product configuration form, a variable in the same group is classifiedGroup.
In the modeling variables section, we have introduced how to create a variable group. to associate a variable group with the product model, you must click the group button on the right, in the displayed form, you can associate a variable group to the product model, and implement a tree structure to place one group under another. A variable group can only appear once in the product model.
According to the tutorial, you can use shift or move down to implement the hierarchical structure of the group. However, I tested it repeatedly and felt that this was unavailable. We recommend that you drag and drop the hierarchy. Displays the variable groups associated with a product model.
Then, you can associate some variables to the group on the product model interface.
There are two display modes in the Product Model configuration form: normal and tree structure.
In normal mode, the measurement in the preceding example is used as Tabpage But there is a problem at this time. The measurement group must contain at least one variable in the product model; otherwise, an error is reported. In essence, for such a structure with two or more layers, it cannot be run in normal mode. You can only use a tree structure.
The common mode and tree structure are switched through Product Generator -> Set -> Parameter settings -> User dialog box -> Display the user dialog box as a tree structure
Let's take a look at the effects of the two methods.
Normal Mode
Tree Structure
However, as mentioned in the previous article, the user configuration file does not take effect when the tree is displayed. It seems that to solve this problem well, you can only change the code by yourself.
Priority
The second field is the priority. This field specifies the display order of the variables in a variable group in the group. If this field is not entered, it is displayed in the order that it is added to the model group. Theoretically, you must enter 1 , 2 , 3... However, you do not need 1 The starting sequence number, as long as the priority values meet your requirements.
Array and maximum value
These values can only be set in the variable group to which the variable belongs. , Select the array and maximum value when creating a group. Array means that all the modeling variables in this group are Grid The maximum value indicates the number of rows in the group.
See the figure.
Variable test Array Group Measurement Is an array type, and its maximum value is 3 , As shown in the figure Grid There are three rows.
Inheritance and return values
Both fields are related to inheritance. One decides whether to inherit values from the parent product model, and the other determines whether to return values to the parent product model. Both inherited and returned value variables must have the same name.
So far, the tutorial has not introduced how to inherit a product type from another product model, so I will not speculate here. Check if there is any description later in the tutorial (which seems to be none ).
Including
Indicates whether this field is used to search for reusable configurations. This field is only selected Product Generator -> Set -> Parameter settings -> Review -> Reuse Configuration Prompt or always Hour Will appear, choose never It will not appear.
So far, the tutorial has not introduced how to search for reusable configurations. We will discuss it in detail later.
Variable calculation settings
Unlike modeling variables, computing variables are not visible in the product configuration form. Computing variables are used to process various intermediate computations in the product model or to retrieve data from other parts of the system. For example, some calculations must be executed in the production module (such as computing BOM (Row material consumption) or some data must be captured from other tables. Computing variables can be defined in the upper part of the product model definition. The defined values include the system, simple, data type, table, class.
Next we will introduce them one by one:
System
The following system variables can be defined:
Transfer variable
Bill of materials ID
Process Route ID
Batch ID
Item No.
Configuration
Quantity
Except for the transfer variable, only one variable can be defined.
Transfer Type variables can be used to transmit data between parent and child product models. Batch ID The item number and configuration type are useful when transferring information from the order line and quotation line to the current item configuration.
The transfer variable is the only system variable that needs to be specified in the product model. Other System variables can be automatically obtained according to the configuration line information during product configuration.
Simple
In simple variables, you can define four types of variables: Text, enumerated text, integer, and real number. Simple variables do not have special functions and are only used to store computing data.
Data Type
Variables defined by the EDT type, such as accountnum, are used to store customer code. Simple variables and data types are the most common types of variables used in addition to modeling variables in the logical conditions for building product models.
Table
If you need to use table-type variables in the X ++ code, you can define them here.
Class
If the X ++ code always needs to use the system class in ax to handle certain requirements, it can be defined here. The two types of variables, table and class, are defined to use them in the module.
The above types will be detailed in PBII. Here we will take a general look.
Before creating a modeling tree and using the product configuration form, you can test the product model. There are two operation paths
Product builder> product model> function> Test Model
Product builder> product model> Test Model
New item number and (or) dimension
You can specify a new number to replace the original materials used for configuration. This is normal because the original materials used for configuration associated with the product model do not specify any attributes, therefore, after configuration, it is the correct idea to generate a new item number based on a rule, and then send it according to the new item number and (or) dimension during the formal delivery.
You can use the product builder> product model> Settings> Generate materials and dimensions to set the encoding rules for the generated materials and/or dimensions. The variables associated with the product model can be used as part of the generated material or dimension encoding rules. If no variable is specified as part of the encoding rules, the corresponding encoding will be generated according to the encoding rules set in the product generator parameter settings.
To prevent different product configurations from using the same encoding, specify an encoding rule in the product generator parameter configuration.
Price combination
The configured product can calculate its sales price through the price combination function, and of course its price can also be obtained through the standard BOM calculation. How can we switch between the two features?
Product builder-> Settings-> parameter settings-> sales price calculation If this option is selected, the price is calculated based on the standard Bom, if this option is not selected, the sales price is calculated based on the configuration of the price combination.
The price of a sales combination is based on the sales price of the product (derived from the product form or trade agreement), and then adjusted based on the user selection in the product builder configuration form.
There are three types of price adjustment methods: amount, percentage, and calculated.
Amount adjustment method: the adjusted price is equal to the standard sales price of the product plus the amount entered in the price adjustment field;
Percent adjustment method: the adjusted price is equal to the adjusted percentage filled in the price adjustment field before the adjustment. The base price of the adjustment method is the adjusted price through the amount adjustment method.
Calculated Adjustment Method: You can use the price/discount setting formula to calculate the adjusted amount.
The price combination form has two buttons:
Adjust by currency price: This button only works when the amount is adjusted;
Price/discount settings: When you adjust the amount and percentage, the formula set in the corresponding form determines whether the amount and percentage adjustment methods take effect; when the adjustment method is calculated, the calculation result of the formula set in the corresponding form is the adjusted amount. You can use X ++ code to set verification rules and computing companies.
The price adjustment field is only available when the amount Adjustment Method and percentage adjustment method are used. The calculated value is calculated using the formula set in the price/discount settings form.
Product graphics
Product graphics can be used to reflect the user's selection in the product configuration form in the form of images. If the image is configured for the product model, A separate tab page will be used in the product configuration form to display images, and images can be printed at the configured row.
In addition, the image of this product does not automatically generate an image based on the user's selected value. After all, ax is not a CAD software. This function only places the image prepared in advance under a folder, ax automatically associates it with the configuration line. After you select the relevant variables, you can see the corresponding picture, which is more intuitive.
The operation path for configuring the product image is as follows:
Product builder> product model> Settings> graphic parameters.
When setting an image, you can select which variables in the product model are reflected in the image to reflect the combination of variable values selected by various users. The image must be created first, and put it in the specified folder. When the value selected by the user changes, the image is found in the specified folder Based on the file name and displayed on the image tab.
Enter values such as % 1... % N in the file format, which will be replaced by the actual value selected by the user.
In this example, % 1 will be replaced by a value actually entered by the user. Because size is of the text type, the value entered by the user may be very long, therefore, you can use the length field to extract part of the input as part of the file name.
If you do not select any image or the corresponding image is not found in the specified folder, the image tab displays the image specified in the default image. Of course, this image must be prepared in advance and placed in the specified folder.
When the user finally confirms the configuration, the corresponding image will be copied to the File Processing System of ax and associated with the configuration line. The document format saved in the ax document processing system can be set in product builder> Settings> parameter settings> User Dialog Box> Generate graphic document type.
Sometimes many configurations correspond to an image. That is to say, a variable may have many optional values, such as the height of a person, from MB to MB, in this case, it is unrealistic to draw an image for each cm to match the user's choice. Only one range can be set to correspond to one image within the range, for example, a variable in the range of 0.5 m -- 1.0m corresponds to an image, so that the value in the range entered by the user will correspond to the same image.
Ax uses an interval to handle this situation. Note that the interval can only be used for numeric variables.
In addition, the image processing of the product generator is also problematic in the Chinese environment. This article will explain it separately.