Scope: managed applications, mobile applications, and ordinary applications.
1. This recommendation applies to scenarios where an infobase object becomes outdated either on a permanent or temporary basis (for example, an employee is dismissed or goes on maternity leave, a department is disbanded, and so on). It is unacceptable to delete this object from the infobase so as to maintain the reference integrity: other previously created objects must refer to it. For example, an object of the File type must have a reference to a dismissed employee after their dismissal in the Author field.
2. To prohibit selecting irrelevant objects using automatic completion and quick selection in input fields, select one of the two implementation approaches (2.1 or 2.2). Have a look at how they are used on the example of infobase users listed in the Users catalog.
To keep records of irrelevant users, the Users catalog now has the Invalid attribute (Boolean). It is False by default.
2.1.1. In the Users catalog manager module, ChoiceDataGetProcessing and FormGetProcessing handlers are implemented to set filter parameters. See an example of implementing these handlers for the Users catalog below:
Procedure ChoiceDataGetProcessing(ChoiceData, Parameters, StandardProcessing)
If Not Parameters.Filter.Property("Invalid") Then
Procedure FormGetProcessing(FormType, Parameters, SelectedForm, AdditionalInformation, StandardProcessing)
If FormType= "ChoiceForm" Then
ParameterChanged = False;
If Not Parameters.Property("Filter") Then
Parameters.Insert("Filter", New Structure("Invalid", False));
ParameterChanged = True;
ElseIf Not Parameters.Filter.Property("Invalid") Then
ParameterChanged = True;
// This code is required to use modified parameter values
If ParameterChanged Then
SelectedForm= "ChoiceForm"; // passing the selection form name
2.1.2. For the attributes where this behavior must be changed (for example, all users are to be displayed or another restriction must be applied), explicitly set the Selection parameters and Selection parameter links properties with selection values required for a specific context:
- If there is no need to select invalid users, specify Filter.Invalid(False) in the Selection parameters attribute property.
- If it is not required to restrict selection, both values are True and False.
- The Users catalog manager module is not implemented.
- In the simplest case, for all objects with attributes of the CatalogRef.Users type, set the Selection parameters and Selection parameter links property values as described above in cl. 2.1.2.
- If a restriction criterion cannot be described with selection parameters, implement the ChoiceDataGetProcessing, ChoiceProcessing, and TextEditEnd form handlers and develop a separate selection form where the same restriction logic is implemented.
3. It is recommended that you add the "Show invalid users" check box in the user list and selection forms. Use it to select or open a user profile, or to make a user valid again (for example, if an employee is back from maternity leave).