I have create a Common Module, with thes three properties checked: Client, Server and Server call. Here is the code (The Common Module name is ServiceSrv):
Code
&AtClient
Function ClientMethod() Export
ServiceSrv.ServerMethod();
Return "";
EndFunction
&AtServer
Procedure ServerMethod() Export
// TODO
EndProcedure
Then, I have an AtClient method that calls an AtServer method, both are defined inside the same Common module, but when I run the application and execute the AtClient method from a Common Form, an error raises saying "Object module not found (MethodServer)"
in your case, you don't need to specify the "&AtClient" and "&AtServer" prefixes. Since the place of code execution, in this case, is determined by the settings of the Common module, and you have enabled the "Server" and "Client" flags for your module.
Accordingly, the code should look like this:
Code
Function ClientMethod() Export
ServerMethod();
Return "";
EndFunction
Procedure ServerMethod()
EndProcedure
If we want the code to be executed strictly on the server, then we must create a separate module with "Server = True", create an export procedure in this module, and call this procedure from the module with "Client = True".
You can read more details here:
Pages:1
Users browsing this topic (guests: 1, registered: 0, hidden: 0)