Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.99 KB

DataExchangeLoading.md

File metadata and controls

47 lines (36 loc) · 1.99 KB

There is no check for the attribute DataExchange.Load in the object's event handler (DataExchangeLoading)

Description

All actions in the event-handler procedures BeforeWrite, OnWrite, BeforeDelete should be performed after checking for DataExchange.Load.

This is necessary so that no business logic of the object is executed when writing the object through the data exchange mechanism, since it has already been executed for the object in the node where it was created. In this case, all data is loaded into the Information Base "as is", without distortion (changes), checks or any other actions that prevent data loading.

Examples

Incorrect:

Procedure BeforeWrite(Cancel) 

     If Not Cancel Then
        RumMyFunction();
    EndIf;

    // other code
    //
    // ...

EndProcedure

Correct:

Procedure BeforeWrite(Cancel) 

     If DataExchange.Load Then
        Return;
    EndIf;

    // other code
    //
    // ...
EndProcedure

Sources