BSL245 — Server-side export form method¶
Summary¶
Server-side export form method
Identifiers¶
| Field | Value |
|---|---|
| Rule code | BSL245 |
| Compatible alias | ServerSideExportFormMethod |
| Severity | WARNING |
| Enabled by default | Yes |
| Implemented | Yes |
| Tags | correctness, ui |
Behavior¶
- The public identifier
BSL245and aliasServerSideExportFormMethodare stable. - The rule reports the cases documented on this page.
- Suppressions and project configuration are applied before publication.
- The rule requires neither an external analyzer nor network access.
Configuration and suppression¶
BSL### is the primary stable identifier. The compatible alias is accepted
in select, ignore, and compatible block suppression comments.
All three suppression families support both a current line and a range. When an opening comment follows code, it affects only that line. Use any one form:
noqa:
bsl-disable:
- compatible
BSLLSform:
When the same opening comment is on a line by itself, it starts a range. Close it with the matching marker from the same family:
// noqa: BSL245
// code without this diagnostic
// noqa-enable: BSL245
// bsl-disable: BSL245
// code without this diagnostic
// bsl-enable: BSL245
// BSLLS:ServerSideExportFormMethod-off
// code without this diagnostic
// BSLLS:ServerSideExportFormMethod-on
To disable the rule until the end of the file, omit the closing
noqa-enable, bsl-enable, or BSLLS:…-on marker.
Opening and closing markers must belong to the same family.
Description¶
In a form module, you can declare export methods that are available in the client context (usually, these are form notification event handlers). For export methods of the form, only the compilation directive AtClient can be specified, since for the rest there is no practical sense: accessing form methods from outside is available only after calling the method GetForm, which is available only on the client.
Specifying a different compilation directive for the export method or its absence is considered an error.
In some versions of the 1C:Enterprise platform, there was an error that allowed using export server-side methods of forms, but it is unacceptable to design a solution using undocumented platform capabilities.
Examples¶
Incorrect use of export methods on a form
Procedure One() Export
// procedure without directive is available on the server
EndProcedure
&AtServerNoContext
Procedure AtServerNoContext() Export
EndProcedure
&AtServer
Procedure AtServer() Export
EndProcedure