All of our development thus far has been VL. Every file I create has a corresponding "Shared Routine" Reusable part that contains all the Routines to Fetch, Add, Update, Delete all data for that particular file in one single object. This "Shared Routine" has method routines that receive the parameters needed and then typically calls a server function which processes and returns the info needed. Every program creates, uses, and destroys these objects as needed. I believe that is standard setup??
Now I'm wanting to create some VL Web Pages that interact with these same objects. All of "Shared Routine" RPs were set up as Target Platform: "Windows/IBM i/Linux". I see I can change the Target Platform to "All Platforms" which breaks any Check,Delete, Insert, etc. I'm ok with that if there is a better way of setting it up so both Web & VL can access it.
I want to have 1 Shared Routine that both Web & VL can use in harmony without having to code in a Server Function and again in a Server Module. For example, if I want to return a data set on Employees, I shouldn't have to code the select logic twice: 1 for VL, & 1 for VL Web.
Does anyone have a fancy way of managing this ?
Fingers Crossed,
Chad Lawing
Sherrill Furniture
A Question about VL & Web Data Access
Re: A Question about VL & Web Data Access
I had asked this a long while back and got an answer about using FUNCTIONs that either call another function or a server function, depending on platform. I think dingoateme responded. I gave up before I got it to work very well.lawingo wrote: ↑Fri May 22, 2020 1:29 amAll of our development thus far has been VL. Every file I create has a corresponding "Shared Routine" Reusable part that contains all the Routines to Fetch, Add, Update, Delete all data for that particular file in one single object. This "Shared Routine" has method routines that receive the parameters needed and then typically calls a server function which processes and returns the info needed. Every program creates, uses, and destroys these objects as needed. I believe that is standard setup??
Now I'm wanting to create some VL Web Pages that interact with these same objects. All of "Shared Routine" RPs were set up as Target Platform: "Windows/IBM i/Linux". I see I can change the Target Platform to "All Platforms" which breaks any Check,Delete, Insert, etc. I'm ok with that if there is a better way of setting it up so both Web & VL can access it.
I want to have 1 Shared Routine that both Web & VL can use in harmony without having to code in a Server Function and again in a Server Module. For example, if I want to return a data set on Employees, I shouldn't have to code the select logic twice: 1 for VL, & 1 for VL Web.
Does anyone have a fancy way of managing this ?
Fingers Crossed,
Chad Lawing
Sherrill Furniture
I'm very interested in this topic, the idea that RDMLX works anywhere isn't completely true.
Server functions can call your functions, but you would have to code the server function to at least pass the same parameters, EXCHANGE them into the function and return the values.
Art Tostaine
Re: A Question about VL & Web Data Access
We do VLWeb and VLF-One only.
Use a lot of Functions to share functionality across different things, but you cannot call them from VLWeb.
So you end up having to have a Server Module to act as a "Proxy" and as Art mentioned you have to "exchange" them to the function. Took me a little bit to grok this and then you have lists that work differently. The Lists work out ok, as you can pass them to a Function (note these are not the PRIM_LIST objects).
When we went down this path it worked out ok, in hindsight I think it abuses the Functions and the limitations of the Function Identifiers (shorter length) and Process Restrictions ( only so many Function in a Process) makes them somewhat frustrating to work with.
Not really helpful I know, but I don't know of an elegant solution.
Joe
Side note:
I really wish a Server Module to map to Component or a Collection Component instead of only being able to map to Fields. This would allow using a Component Model instead of Fields which would then allow me to convert the Functions into a Resuable Part without all the plumbing code.
Use a lot of Functions to share functionality across different things, but you cannot call them from VLWeb.
So you end up having to have a Server Module to act as a "Proxy" and as Art mentioned you have to "exchange" them to the function. Took me a little bit to grok this and then you have lists that work differently. The Lists work out ok, as you can pass them to a Function (note these are not the PRIM_LIST objects).
When we went down this path it worked out ok, in hindsight I think it abuses the Functions and the limitations of the Function Identifiers (shorter length) and Process Restrictions ( only so many Function in a Process) makes them somewhat frustrating to work with.
Not really helpful I know, but I don't know of an elegant solution.

Joe
Side note:
I really wish a Server Module to map to Component or a Collection Component instead of only being able to map to Fields. This would allow using a Component Model instead of Fields which would then allow me to convert the Functions into a Resuable Part without all the plumbing code.
Re: A Question about VL & Web Data Access
That's what I figured. Thanks for the feedback!
Best,
Chad
Best,
Chad