Custom Field Toggle Choices
[Added in Version 21, build on December 16, 2019]
For objects that have custom strings, integers or floating point numbers defined, the user may specify a list of toggle choices for a particular custom fields. This is done by defining CustomFieldToggleChoice objects
To view the Custom Field Toggle Choices, open Custom Field Toggle Choices found under the Case Information and Auxiliary folder on the Model Explorer. The table lists the object types for which custom field toggle choices have been defined. In addition, they can also be defined to the Toggle Choices tab on the Custom Field Description Dialog
To insert a new toggle choice, select Records > Insert from the case information toolbar. This will display a dialog asking you to choose and Object Type and a field to which you would like to add a toggle choice. After choosing this, a CustomFieldToggleChoice will be created with an Order one larger than the present maximum order and a default Choice string will be set. The should then edit the Order and the Choice fields as desired.
To modify an existing toggle choice, choose Show Dialog from the case information toolbar. This will open the Custom Field Description dialog and take you to the Toggle Tab listing all the present CustomFieldToggleChoices for the object type and variable name chosen.
Once Toggle choices for a custom field have been defined, the user interface will treat this field as a Toggleable field. It is possible that a custom field has been set for an object before CustomFieldToggleChoices have been defined. In this situation the field may not match one of the CustomFieldToggleChoices that are defined. When this happens, PowerWorld will not enforce any correction. PowerWorld only enforces the restriction on a toggle choice when it is being entered. The following rules will be applied when editing a custom field for which custom toggle choices have been defined.
- When editing any custom integer, float, or string, an entry of blank is always permitted and will result in that custom field being set to blank (meaning not defined). This will be done regardless of whether a Toggle Choice of blank has been explicitly defined.
- When editing a custom string field for which toggle choices have been defined, any entry that does not match one of the choices will be ignored and the custom string will not be changed.
- When editing a custom integer or floating point number field for which toggle choices have been defined, any entry that does not match one of the choices will be set to the toggle choice that is the closest numerically to the entry.
CustomFieldToggleChoice objects are defined by the following fields:
Object Type (key field)
Type of object for which this is available. This field can only be set when creating the object.
Variable Name (key field)
This refers to the variable name for which the toggle choice applied. Remember that the variable name is off by one from the field. Thus the first custom string will have a variable name of CustomString:0, the second will be CustomString:1 and so on. This field can also only be set when creating the object
Order (key field)
This is an integer indicating the order precedence for the choices. When shown in a drop-down inside the user interface, choices with lower Order number will be shown before choices with a higher order number.
Choice (required field for creation)
This is the String for the choice that will be displayed. A blank choice can be explicitly defined as a choice and is appropriate to make it clear users may clear out choices. For custom integer choices only strings that represent an integer will be accepted. For floating point choices, only strings that represent a number will be accepted.