Desktop version

Main > Forum > Learning > 1C Mobile Developer Course > Error CommonFunction is not defined - Module 5: Sample infobase

Forum

Search UsersRules
Error CommonFunction is not defined - Module 5: Sample infobase
#1
Active user
Points:: 0
Joined:: Jan 11, 2021

Hi every one,
I'm following the sample infobase in Module 5.
I got a problem that the debugger said that my CommonFunctions is not defined but I adlready defined it in Common modules



And my code is nearly the same to the sample


Here is the error

Profile
#2
Active user
Points:: 0
Joined:: Jan 11, 2021

An here is my dt file.
Thank for your help

Profile
#3
Active user
Points:: 0
Joined:: Jan 11, 2021

Finally, I've got the answer

Profile
#4
Administrator
Points:: 0
Joined:: Oct 3, 2019

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 :-)

Profile
#5
Active user
Points:: 0
Joined:: Jan 11, 2021

Thank for your explaination. It is really helpful

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.