An example of preparing "customer ID" and "branch number" is shown in Fig.(Each is the primary key.The initial value of the branch number is 1.
Here, using the copy registration function,With the same customer IDI will try to register.
On the registration/update screen, the branch number is automatically hidden.
The branch number increases.(Figure 3)
The branch number is managed for each data.If the customer ID changes, the branch number will be 1.
Figure 5 shows an example of "customer ID" and "branch number" items prepared for customer model.
The customer ID is the primary key.In this example it is a character string, so we can enter it.(We do not use "order" for automatic number assignment.)
The branch number is also the primary key.And "Use as branch number" is enabled.The starting number is 1.
Using an order for the primary key (automatic numbering), but when used in conjunction with setting that does not use the sequence at the time of copy registration, it is said that "only at the time of copy registration (because duplication of primary key occurs)" branch number is given I will explain an example.
It is a new registration screen."Customer ID" and "branch number" are both hidden.
It is the screen immediately after new registration.The branch number is "1".
I will try copy registration next.In copy registration, the order is not used, so "customer ID" will be duplicated.
The branch number increases.
The customer ID uses the order, but at the same time, the setting "Do not use the order at copy registration" is enabled.(FIG. 12)
The definition of the branch number is the same as in Figure 7.The branch number designation is valid for "Use as primary key".
Here is an example of setting alphabetical notation A, B, C, ... instead of integer numbers 1, 2, 3, .... Figure 14 is just after registering the data for the primary key "A-0001".The branch number is not included here.
Using the copy registration function, try to re-register the data with the same primary key.(FIG. 15)
"A" was added to the end of the key.This is a branch number.
If you register with the same primary key "A - 0001" again, the branch number "B" will be granted this time. Subsequently, the branch number is assigned A, B, C, ... Z, and after Z, it is AA.
We prepare three items "customer ID" "branch number (hidden)" "customer ID".The first "customer ID" is displayed in the registration/update screen.Another "customer ID" is for display, and it displays it in a form joined with the branch number at the end according to the calculation formula.
Detailed setting of each item is as follows.
|item name||Item ID||Type||Primary key||Branch number||order||Start number||DB storage||Hidden on input||Hidden on output|
|Branch number (hidden)||branchid||Numerical value||○||○||-||1||○||○||○|
The following automatic calculation formula is applied to the "customer ID" (customeridshow) item used for display.
Wagby may not be able to use compound key models with some functions.
In order to avoid this constraint, you can also set "branch number applying narrow-down function with single key".