Scope: managed applications, mobile applications, and ordinary applications.
1. In event handlers of object modules, record sets, forms, and other that contain the Cancel parameter (OnWrite, FillCheckProcessing, GoodsBeforeAddRow, and other), do not set this parameter to False.
This requirement applies since the Cancel parameter can usually be set in multiple consecutive checks at once (or multiple subscriptions to the same event) in event handler code. In this case, by the time the check is completed, the Cancel parameter might have already had the True value, and thus you can incorrectly reset it to False.
Moreover, the number of these checks can increase upon deployed configuration update.
Incorrect:
Procedure FillCheckProcessing(Cancel, CheckedAttributes) ... Cancel = HasFillingErrors(); ... EndProcedure
Correct:
Procedure FillCheckProcessing(Cancel, CheckedAttributes) ... If HasFillingErrors() Then Cancel = True; EndIf; ... EndProcedure
or
Cancel = Cancel Or HasFillingErrors();
2. The same requirements apply to other similar parameters of event handlers: StandardProcessing, Execute, and other.
For example:
Procedure ChoiceDataGetProcessing(ChoiceData, Parameters, StandardProcessing) If Parameters.Properties(...) Then StandardProcessing = False; ...
EndIf; EndProcedure