Indeed. The "Execute on server” method attribute is very different from the “Execute on server” command. The former says “Run this code on the server and return a value” while the latter starts a stored procedure.
Tom Benedict > On Apr 24, 2020, at 15:52, lists via 4D_Tech <[email protected]> wrote: > > Chris, > > Just create a regular method, mark it as "Execute on Server" in the method > properties, then call it just like any other method. You can return anything > you want in $0 > > $myData:=ThisMethodRunOnServer(whatever) > > Just make sure to check that little box in the ThisMethodRunOnServer Method > properties and you are all done... > > Lahav > > -----Original Message----- > From: 4D_Tech <[email protected]> On Behalf Of Chris Belanger via > 4D_Tech > Sent: Friday, April 24, 2020 4:44 PM > To: 4D iNUG Technical <[email protected]> > Cc: Chris Belanger <[email protected]> > Subject: Re: 4D v18 — Need methodology to > > Hi Olivier, > I am looking for SIMPLE, alright. > I have looked at ‘execute on server’ but I do not see how it sends anything > to the client other than the process number (in $0). > What have I missing about it? > I used it in the past (when I made a ‘communicator’ subsystem in classic 4D) > but it involved ‘variable to variable’, pausing/resuming processes and the > like, and involved quite a bit of intricate programming. > > — Chris > > >> On Apr 24, 2020, at 5:27 AM, Olivier Flury via 4D_Tech >> <[email protected]> wrote: >> >> Maybe too simple for what you need to do, but have a look at the "execute on >> server" property for project methods. >> >> Create a method that is executed on server. It gets as $1 the id of the >> document you want to display on the client side. The method does everything >> to fetch the document from the directory on the server etc. and sends it to >> the client in $0. >> >> Keep in mind that this method (executed on server) behaves similar to a >> trigger method: you are read/write for all tables and you should have your >> own On Err Call method. >> >> Best, >> >> Olivier >> >> |||||| https://flury-software.ch/ >> >> -----Ursprüngliche Nachricht----- >> Von: 4D_Tech <[email protected]> Im Auftrag von Chris Belanger >> via 4D_Tech >> Gesendet: Freitag, 24. April 2020 10:57 >> An: 4D iNUG Technical <[email protected]> >> Cc: Chris Belanger <[email protected]> >> Betreff: 4D v18 — Need methodology to >> >> I have a methodology of allowing clients to transfer documents that are >> thereafter stored by 4D Server in a ‘LIBRARY’ of system documents it >> maintains automatically. [these are not stored in the DB, but in a managed >> folder on disk.] >> >> I do this by: >> • Loading a system document into a BLOB, then using BASE64 ENCODE to store >> it in a TEXT field; —— thanks Peter Bozek for the tip on BASE64 ENCODE / >> DECODE! >> • the TRIGGER method (running on 4D server) unpacks it and creates / updates >> the files in its ‘Library’ directory on disk. >> >> Now I need to be able to retrieve the contents of these files for 4D >> [Client]. >> I can display the files in a Web Area —> Thanks to Keith for the tip. >> >> ** But I am looking for a simple way to get 4D Server to ’send’ the data to >> the CLIENT (4D) upon request. >> >> In the past [since v12), I made elaborate ‘communicator’ stored routines to >> fudge it, but I have a feeling that now there are better ways to do it. >> >> I wish it was simple as: >> Request_Document ( $LibraryEntity ) —> Document Contents [retrieved from >> the library of user’s documents stored by 4D Server on disk] >> >> Any suggestions? Do I have to use Workers, or Stored Procedures, or >> something? >> >> Thank you, guys & gals, >> >> Chris Belanger >> ********************************************************************** >> 4D Internet Users Group (4D iNUG) >> Archive: http://lists.4d.com/archives.html >> Options: https://lists.4d.com/mailman/options/4d_tech >> Unsub: mailto:[email protected] >> ********************************************************************** >> >> ********************************************************************** >> 4D Internet Users Group (4D iNUG) >> Archive: http://lists.4d.com/archives.html >> Options: https://lists.4d.com/mailman/options/4d_tech >> Unsub: mailto:[email protected] >> ********************************************************************** > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

