Re: Multi-Table Query Into JSON?

2018-03-24 Thread Keisuke Miyako via 4D_Tech
Hello, "Movable form dialog box" is not the same as "Movable dialog box", even if the constant values are both 5. Open window and Open form window do not simply differ in the parameter list, the former is based on an old API which is why it is recommend to not use it anymore. "Movable form dial

Re: Multi-Table Query Into JSON?

2018-03-23 Thread Keith Culotta via 4D_Tech
The "Movable form dialog box" type became available for "Open form window" at some point. It is also constant 5. A "Plain form window" with Cancel in the Deactivate event is user friendly, but will probably appear behind a floating window. Keith - CDI > On Mar 23, 2018, at 12:15 PM, Keisuke

Re: Multi-Table Query Into JSON?

2018-03-23 Thread Keisuke Miyako via 4D_Tech
as far as the window type is concerned, ALERT is like any DIALOG, you can pass the constant Movable dialog box to Open window to get similar effect. http://doc.4d.com/4Dv16/4D/16.3/Window-Types-compatibility.300-3651740.en.html note that this kind of window is not available for Open form window.

Re: Multi-Table Query Into JSON?

2018-03-23 Thread Kirk Brooks via 4D_Tech
On Thu, Mar 22, 2018 at 10:48 PM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote: > it’s not that the command has negative attributes, it’s more to do with > the fact that the command is too basic. a similar example is ALERT. I know > many applications use it in production, and there is

Re: Multi-Table Query Into JSON?

2018-03-23 Thread Keisuke Miyako via 4D_Tech
just as a reminder: the preferred option to configure automatic relations in code is to use SET FIELD RELATION. http://doc.4d.com/4Dv15/4D/15.5/GET-FIELD-RELATION.301-3577374.en.html the scope is the current process and you have better control over which relations to automate. 2018/03/23 12:5

Re: Multi-Table Query Into JSON?

2018-03-23 Thread Kelderic via 4D_Tech
I ended up writing a wrapper method called SelectionToJSON (named to match our existing naming convention), which is called like this: SelectionToJSON("Table";"[Table]Field1;[Table]Field2;[RelatedTable]Field1") Inside the method, it breaks apart the second parameter and builds a template object.

Re: Multi-Table Query Into JSON?

2018-03-22 Thread Keisuke Miyako via 4D_Tech
it’s not that the command has negative attributes, it’s more to do with the fact that the command is too basic. a similar example is ALERT. I know many applications use it in production, and there is nothing wrong about that, but fir me, it is primarily a development tool for quick testing, I wo

Re: Multi-Table Query Into JSON?

2018-03-22 Thread Tim Nevels via 4D_Tech
On Mar 22, 2018, at 8:23 PM, Keisuke Miyako wrote: > Selection to json is a very simple command with very specific usages. > > it is nothing like selection to array. > > put another way, it is not an important command, you don’t need to know it, > there is nothing you can’t do without it. > >

Re: Multi-Table Query Into JSON?

2018-03-22 Thread Keisuke Miyako via 4D_Tech
it’s when you call it on a “template” object whose property values are pointers to fields. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: https://

Re: Multi-Table Query Into JSON?

2018-03-22 Thread Jeremy French via 4D_Tech
What is “template mode” for OB Copy? > On Mar 22, 2018, at 9:14 PM, Keisuke Miyako via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > if you are interested in getting an object array, you should not go through > json, you should procedurally use OB commands (OB copy in template mode). you > can c

Re: Multi-Table Query Into JSON?

2018-03-22 Thread Keisuke Miyako via 4D_Tech
Selection to json is a very simple command with very specific usages. it is nothing like selection to array. put another way, it is not an important command, you don’t need to know it, there is nothing you can’t do without it. it is like a convenience command for quick testing when you want to

Re: Multi-Table Query Into JSON?

2018-03-22 Thread Douglas von Roeder via 4D_Tech
Kelderic: You're welcome. The examples in the docs illustrate how the command can be used but, as we've seen, they're *not* exhaustive. In this case, the functionality works in V15 but never made it to the docs. Over the years (decades) 4D has created it's own little "circle of life" thing with

Re: Multi-Table Query Into JSON?

2018-03-22 Thread Kelderic via 4D_Tech
We are currently running on v15, not v16. The documentation for Selection to JSON for v15 doesn't have example two. I'll try running it and see if it works, or at least use this as a reason to push for updating 4D. Thanks, mate. -- Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html

Re: Multi-Table Query Into JSON?

2018-03-22 Thread Douglas von Roeder via 4D_Tech
I haven't used SQL to load records into objects but the command Selection to JSON does allow you to load multiple fields, as well as fields from different tables. Refer to the section entitled "Example 2" which is new in th

Multi-Table Query Into JSON?

2018-03-22 Thread Kelderic via 4D_Tech
I have a database with tables that are linked together via IDs. Simplified example: CallLogs Table UniqueID, Date, Type, Log, CustomerID Customers Table UniqueID, FirstName, LastName, City, State A CallLogs record will be linked to a Customers record by: [CallLogs]CustomerID = [Customers]Unique