Automatically specify the progression rate based on the status column value
Answer¶
Use "Server Script".
Overview¶
Use "Server Script" to automatically specify the progression rate according to the value selected in the "Status" column in the bulk edit mode of the edit screen and Screen Index. The corresponding progression rate in the sample introduced on this page is specified according to the code assigned to the "Status" column as shown in the table below.
| Code | Option | Progression rate |
|---|---|---|
| 150 | Preparation | 10% |
| 200 | Running | 50% |
| 300 | Under Review | 90% |
| 900 | Done | 100% |
| (Not selected) | Other | 0% |
Operation¶
- Create a "Time-limited Table".
- Enable "Status" and "Progression Rate" in "Editor" and "Index" (they are usually enabled).
- "Create new" the following "Server Script". For "Condition", select "After formulas".
Code Samples¶
JavaScript¶
switch (model.Status) {
case 150: // Preparation
model.ProgressRate = 10;
break;
case 200: // Running
model.ProgressRate = 50;
break;
case 300: // Under Review
model.ProgressRate = 90;
break;
case 900: // Done
model.ProgressRate = 100;
break;
default: // Other
model.ProgressRate = 0;
break;
}