Client and Server execution

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

Hi, I have some troubles implementing function which should work on client side and sever side

Code
Function IsRUCValid (RUCN, Type = Undefined) Export

If I use &AtSever then from item form it uses client/server call, if implement it as &AtClient I could not use it at server side which I also need to. It does just simple mathematical calculations, but it is big and I do not want duplicate code for client and for server.
I have used two versions for client and for server with the same name and it work until 8.2.15. But really it seems to me that it is not a good idea to do so. How could I run the exact same part of code from server and client without copying that function?

 
#2
People who like this:0Yes/0No
Active user
Rating: 7
Joined: Sep 26, 2012
Company: individual

If you cre ate function at common module with properties "Client (managed application)" and "Server", so then you can call this function at client or at server

You can look example at 1c subsystems library. There you can find common module StringFunctionsClientServer - functions of this module you can call at client or at server

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.