Dear Phan Hoàng Anh,
with your permission, I will explain what the bug was.
The procedure "AttachmentsTableBeforeAddRow" is launched on the client, and the common module "CommonFunctions" is launched on the server (screenshot 1). Because of this, the methods of the common module "CommonFunctions" are not visible inside the procedure "AttachmentsTableBeforeAddRow".
There are several ways to fix this error. For example, we can also execute the code of the common module "CommonFunctions" on the client (screenshot 2).
We can also change the code for the "AttachmentsTableBeforeAddRow" procedure so that some of this code is executed on the server.
Which method to choose in each case needs to be decided by the developer himself