Re: ORDA - NOT(IN)

2020-04-04 Thread Tom-Lists via 4D_Tech
Yup, that's my bug! [ ] # Null Cheers, Tom > On Mar 26, 2020, at 5:52 PM, Keisuke Miyako via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > remember this discussion? > > good news! common sense prevails! > >

Re: ORDA - NOT(IN)

2020-03-26 Thread Keisuke Miyako via 4D_Tech
remember this discussion? good news! common sense prevails! https://bugs.4d.fr/fixedbugslist?branch=18 #ACI0100614 > 2020/03/04 9:33、Keisuke Miyako のメール: > the inverse of FALSE is TRUE, but the inverse of NULL is NULL. > it's counter-intuitive, but that how NULL works.

Re: ORDA - NOT(IN)

2020-03-03 Thread Keisuke Miyako via 4D_Tech
one more thing, you could go deeper with $params:=New object("queryPlan";True;"queryPath";True) $esTable_1:=ds.Table_1.query("NOT (Field_2 IN :1)";New collection;$params) which yields {"Not":[{"item":"Constant Value: "}]} as opposed to $params:=New object("queryPlan";True;"queryPath";True)

Re: ORDA - NOT(IN)

2020-03-03 Thread Tom-Lists via 4D_Tech
Yup, add any dummy element of any kind (since a collection can be mixed) and you have a work-around. You could instead bypass the query if the search collection is empty, that would be logical, might even be (insignificantly) more efficient . Keisuke mentions a potential issue about "runtime"…

Re: ORDA - NOT(IN)

2020-03-03 Thread Douglas Cryer via 4D_Tech
Adrian, I honestly believe this to be a bug and hope that in the future it will be fixed. Below does not work: $vc_exclude:=New collection //make a simple empty collection $es_MySel:=ds.myTable.query("not(myField in :1)";$vc_exclude) Here are few ways around it: Option 1 - Check and do

Re: ORDA - NOT(IN)

2020-03-03 Thread Adrian Boone via 4D_Tech
That's exactly what I assumed - if the collection is empty, you'd expect that "not in collection" would return everything, but in my experience (v17.1) it returns nothing! The workaround I have for now is to add a dummy element to the collection and that works as expected. In my case it's a

Re: ORDA - NOT(IN)

2020-03-03 Thread Keisuke Miyako via 4D_Tech
I do not have any insider knowledge on this particular point, but I would assume that the runtime simply ignores the instruction and return all entities if the collection is empty (length=0), since the condition is the inverse of a "false" statement. matching an empty string is a different

Re: ORDA - NOT(IN)

2020-03-03 Thread Douglas Cryer via 4D_Tech
Tom, Re: Why is my query of NOT(IN []) versus NOT(IN [""]) producing difference results? I noticed this a few weeks back. The empty collection I was using was the result of a previous query that returned a collection. I had to code around it so if the myCollection.length

Re: ORDA - NOT(IN)

2020-03-01 Thread Chip Scheide via 4D_Tech
maybe because the array [] is not empty when there is a an empty string in it. and the query, in the second case is looking for empty string values, or just string values > > NOT(IN []) >versus > NOT(IN [""]) Hell is other people Jean-Paul Sartre

Re: ORDA - NOT(IN)

2020-03-01 Thread Tom-Lists via 4D_Tech
That's an interesting find, but I don't see that as the case as the value of the variable (as seen in the debugger) remains the same with or without the NEW COLLECTION parenthesis. So my question still stands: Why is my query of NOT(IN []) versus NOT(IN [""]) producing

Re: ORDA - NOT(IN)

2020-03-01 Thread Jeremy French via 4D_Tech
Hi Tom. I believe this statement has a silent syntax error, which the compiler/syntax checker fails to flag: $vC_uuidsToIgnore:=New collection() Remove the parenthesis so you have: $vC_uuidsToIgnore:=New collection See: https://doc.4d.com/4Dv18/4D/18/New-collection.301-4505843.en.html

Re: ORDA previous and next win a form.

2020-01-18 Thread Bernard Escaich via 4D_Tech
Eric, This thread https://forums.4d.com/Post/EN/32868394/1/32881535#32881535 with https://translate.google.com/#view=home=translate=fr=fr could help you. Cordialement, Bernard Escaich > Le 17 janv. 2020 à 18:13, Eric Naujock via

Re: ORDA RELATE MANY SELECTION

2019-12-06 Thread kculotta via 4D_Tech
Kirk, "Just like magic" was my reply to Neil. ORDA is proving to offer more efficiencies than the classic way. The input and output forms, not so much the brain, are starting from scratch with ORDA. The code in the example is in a text object sitting above an entity listbox on the form.

RE: ORDA RELATE MANY SELECTION

2019-12-06 Thread Dennis, Neil via 4D_Tech
> Neil is dead on in the case of RELATE MANY - you can access this directly from > the entity via the name of the relation. But you are asking about > RELATE MANY SELECTION where you have a selection of one-records and > you want a selection of all the many-records. This actually also works for

Re: ORDA RELATE MANY SELECTION

2019-12-06 Thread Christian Sakowski via 4D_Tech
> $col:=ds.Client.query("Name = :1";"@"+Self->+"@") .distinct("PriKey") > EntSel:=ds.Contract.query("to_Client IN :1";$col) No need for this, just write: $clients:=ds.Client.query("Name = :1";"@"+Self->+"@") $contracts:=$clients.Contracts -- Grüße/Regards, [heubach-media] | Christian Sakowski

Re: ORDA RELATE MANY SELECTION

2019-12-06 Thread Kirk Brooks via 4D_Tech
Keith, Neil is dead on in the case of RELATE MANY - you can access this directly from the entity via the name of the relation. But you are asking about RELATE MANY SELECTION where you have a selection of one-records and you want a selection of all the many-records. Your example works fine -

RE: ORDA RELATE MANY SELECTION

2019-12-05 Thread Dennis, Neil via 4D_Tech
> RELATE MANY SELECTION is a convenient way to get a set of related many > records. > Is there a more succinct or efficient ORDA method than the following to do > the same thing? Just dot follow the relation name $clients:=ds.Client.query() $relatedmany:=$clients.ManyRelationLinkName This

Re: ORDA/Collections

2019-10-30 Thread Cannon Smith via 4D_Tech
Hi Justin, Have you taken a look at the extract function on collections? I think it would do what you want. -- Cannon.Smith Synergy Farm Solutions Inc. Aetna, AB Canada > On Oct 30, 2019, at 2:45 PM, Justin Will via 4D_Tech <4d_tech@lists.4d.com> > wrote: > >

Re: ORDA/Collections

2019-10-30 Thread Keisuke Miyako via 4D_Tech
"For each" loop is a good place to start. once you've familiarised yourself with collections and objects, you might want to look into collection methods such as map() for this kind of work. 2019/10/31 9:11、Justin Will mailto:jw...@willwerks.com>>のメール: I couldn't seem to get Selection To JSON

RE: ORDA/Collections

2019-10-30 Thread Justin Will via 4D_Tech
I couldn't seem to get Selection To JSON with a template to do what I wanted to. I ended up writing this and it fits the bill. For each ($oRec;$oRecs) $oComplex:=New object $oComplex.key:=$oRec.ID $oComplex.label:=$oRec.Name $oComplex.open:=True ARRAY

Re: ORDA/Collections

2019-10-30 Thread Keisuke Miyako via 4D_Tech
rather than using ORDA, you could use classic QUERY and call Selection to JSON with a template. https://doc.4d.com/4Dv15/4D/15.6/Selection-to-JSON.301-3817892.en.html the feature allows you rename and reorder your selection of fields however way you like. > 2019/10/31 5:45、Justin Will via

Re: ORDA/Collections

2019-10-30 Thread Kirk Brooks via 4D_Tech
Justin, The replace string approach is not what you want to do. Editing strings and mapping data are not the same thing. You also want to avoid hard coding such maps. Any little change and you have to change code. A fairly easy way to manage what you need to do is save an entity as a stringified

Re: ORDA (Why does query fail to find zero uuid value, i.e ("0"*32))

2019-08-13 Thread Kirk Brooks via 4D_Tech
Jeremy, Try searching the UUID fields for: "20202020202020202020202020202020" I got that here: https://kb.4d.com/assetid=77576 On Tue, Aug 13, 2019 at 3:46 PM Jeremy French via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Give the following > > Table with: > 1) primary key "key_uuid" > 2) another

Re: ORDA and 4D selections

2019-04-10 Thread Arnaud de Montard via 4D_Tech
> Le 10 avr. 2019 à 02:46, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > Chuck, > There is no reason to use ORDA if you need a regular selection. Just use > the classic 4D query commands. It depends, for example you have a nice modern orda based interface and want to print

Re: ORDA and 4D selections

2019-04-10 Thread John DeSoi via 4D_Tech
Good points. The primary disadvantage in my opinion is the loss of table and field referencing because queries and other functions embed everything in strings. Understanding or modifying a large code base (especially if you did not write it) is going to be a lot harder with ORDA versus

Re: ORDA and 4D selections

2019-04-10 Thread Christian Sakowski via 4D_Tech
Chuck and Kirk, ORDA has many advantages compared to the classic 4D language: - no side effects, - no accidentally record locking - working with (named) relations -> much better readable and very powerful - much better support and handling of entitySelections (sets) - now a project method can

Re: ORDA and 4D selections

2019-04-10 Thread Chuck Miller via 4D_Tech
I think returns will be much faster. That is the only reason Regards Chuck Chuck Miller Voice: (617) 739-0306 Informed Solutions, Inc. Fax: (617) 232-1064

Re: ORDA Limiting number of records returned.

2019-04-10 Thread Christian Sakowski via 4D_Tech
> YES! > I have done this for all BLOB or OBJECT heavy tables. > Just created a table called DOC_BLOBS > And only get the records in demand. > A world of difference ) Useless, because internally 4D stores BLOBs and Pictures not in the record by default. -- Grüße/Regards, [heubach-media] |

Re: ORDA Limiting number of records returned.

2019-04-10 Thread Eric Naujock via 4D_Tech
Well I guess I will be refactoring the tables. Originally the table was a monolithic table with hundreds of fields. I have been trying to pare it down by moving uncommon fields to other tables. > On Apr 10, 2019, at 10:13 AM, Herr Alexander Heintz via 4D_Tech > <4d_tech@lists.4d.com> wrote: >

Re: ORDA Limiting number of records returned.

2019-04-10 Thread Herr Alexander Heintz via 4D_Tech
Am 10.04.2019 um 16:09 schrieb Eric Naujock via 4D_Tech <4d_tech@lists.4d.com>: > > Related to the note about 4D Write Pro documents slowing things u. Would it > help to move all the 4D Write documents to a 4D Write table containing the > Write and Write Pro records? YES! I have done this for

Re: ORDA Limiting number of records returned.

2019-04-10 Thread Eric Naujock via 4D_Tech
Related to the note about 4D Write Pro documents slowing things u. Would it help to move all the 4D Write documents to a 4D Write table containing the Write and Write Pro records? The reason for this question is that if I start out with all the records I end up with a table that takes forever

Re: ORDA and 4D selections

2019-04-10 Thread Arnaud de Montard via 4D_Tech
> Le 9 avr. 2019 à 21:21, Douglas von Roeder via 4D_Tech <4d_tech@lists.4d.com> > a écrit : > > “There are simply too many notes.” :-) I'd naturally try in code editor something starting with "entity selection to..." or "selection from...". I dislike command naming starting with a verb

Re: ORDA and 4D selections

2019-04-09 Thread Kirk Brooks via 4D_Tech
Chuck, There is no reason to use ORDA if you need a regular selection. Just use the classic 4D query commands. On Tue, Apr 9, 2019 at 2:27 PM Charles Miller via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Hi all, > > is there any way to perform a query using ORDA and create a current > selection or

Re: ORDA and 4D selections

2019-04-09 Thread Douglas von Roeder via 4D_Tech
“There are simply too many notes.” -- Douglas von Roeder 949-336-2902 On Tue, Apr 9, 2019 at 12:01 PM cjmiller--- via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Thanks I knew it was there but couldn’t find it. Sometimes I wish we still > only had 100s of commands instead of what we have > >

Re: ORDA and 4D selections

2019-04-09 Thread cjmiller--- via 4D_Tech
Thanks I knew it was there but couldn’t find it. Sometimes I wish we still only had 100s of commands instead of what we have Regards Chuck Sent from my iPhone > On Apr 9, 2019, at 2:36 PM, ericklui678 via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Hi Chuck, > > You can use the command USE

Re: ORDA and 4D selections

2019-04-09 Thread ericklui678 via 4D_Tech
Hi Chuck, You can use the command USE ENTITY SELECTION to convert the resulting entity selection to a current selection of that corresponding table. https://doc.4d.com/4Dv17/4D/17.1/USE-ENTITY-SELECTION.301-4179710.en.html

Re: ORDA Limiting number of records returned.

2019-04-08 Thread Christian Sakowski via 4D_Tech
Currently the implementation returns not only a selection, it returns an unknown „page“ of records. So there comes maybe hundreds or more records during the first query. The second point is, that when there are object fields in the dataClass, the query may be very slow. We discovered a 10-13

Re: ORDA Limiting number of records returned.

2019-04-08 Thread Keisuke Miyako via 4D_Tech
ORDA queries only return a reference to the selection and not the entire data set, so it's not as if the payload should be a problem (especially at 35K which is small) but you could slice it to limit the size https://doc.4d.com/4Dv17R4/4D/17-R4/entitySelectionslice.305-4055325.en.html >

Re: ORDA to get "record number" value

2018-11-28 Thread Gianluca Rigotti via 4D_Tech
Thanks to all for the help! Gianluca > Il giorno 28 nov 2018, alle ore 20:52, John DeSoi via 4D_Tech > <4d_tech@lists.4d.com> ha scritto: > If you only need to emulate the Record number function for a particular > entity, you could use getKey() to get the primary key and then Find in field >

Re: ORDA to get "record number" value

2018-11-28 Thread John DeSoi via 4D_Tech
If you only need to emulate the Record number function for a particular entity, you could use getKey() to get the primary key and then Find in field to get the record number. John DeSoi, Ph.D. > On Nov 23, 2018, at 11:10 AM, Gianluca Rigotti via 4D_Tech > <4d_tech@lists.4d.com> wrote: > >

Re: ORDA to get "record number" value

2018-11-28 Thread Tim Nevels via 4D_Tech
On Nov 28, 2018, at 1:27 PM, Christian Sakowski wrote: > Oh… didn’t noticed this. Thanks for the hint. > But anyways… i think he has the answer(s). This thread is as bad as the 4D Forums thread. Nobody will give this guy a direct answer, so he can move on and get some real work done.

Re: ORDA to get "record number" value

2018-11-28 Thread Christian Sakowski via 4D_Tech
Oh… didn’t noticed this. Thanks for the hint. But anyways… i think he has the answer(s). -- Grüße/Regards, [heubach-media] | Christian Sakowski christian.sakow...@heubach-media.de Tel: +49/(0)40/52 10 59-23 > Am 28.11.2018 um 20:03 schrieb Lee Hinde via 4D_Tech <4d_tech@lists.4d.com>: > >

Re: ORDA to get "record number" value

2018-11-28 Thread Lee Hinde via 4D_Tech
That’s his thread. :-) > On Nov 28, 2018, at 10:48 AM, Christian Sakowski via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > Hi, > > see discussion here: > > http://forums.4d.com/Post/FR/27391864/1/27436514#27436514 > -- > > Grüße/Regards, > [heubach-media] | Christian Sakowski >

Re: ORDA to get "record number" value

2018-11-28 Thread Christian Sakowski via 4D_Tech
Hi, see discussion here: http://forums.4d.com/Post/FR/27391864/1/27436514#27436514 -- Grüße/Regards, [heubach-media] | Christian Sakowski christian.sakow...@heubach-media.de Tel: +49/(0)40/52 10 59-23 > Am 23.11.2018 um 18:10 schrieb Gianluca Rigotti via 4D_Tech > <4d_tech@lists.4d.com>: >

Re: ORDA Entity From

2018-10-23 Thread Peter Bozek via 4D_Tech
On Tue, Oct 23, 2018 at 10:23 PM Dennis, Neil via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Is there a way to determine where an entity is from? In the debugger it > shows in the value "Entity () from ", but I can't fine a way to > get using a method from code. Does such a method exist? > > Neil

Re: ORDA Entity From

2018-10-23 Thread Douglas von Roeder via 4D_Tech
Julio: Thanks for that input. I must have missed your message about this. OK, off the place that's proof that disco did *not* die - the 4D Forum! -- Douglas von Roeder 949-336-2902 On Tue, Oct 23, 2018 at 3:08 PM Julio Carneiro via 4D_Tech < 4d_tech@lists.4d.com> wrote: > as I mentioned on

Re: ORDA Entity From

2018-10-23 Thread Julio Carneiro via 4D_Tech
as I mentioned on an earlier post, I’ve put that as a request to 4D and the response I got was that ‘it may come in a future release” if you have access to the beta forum, go vote for it: http://forums.4d.com/Post/EN/25274556/1/25274557 may they get into the next release :-) > On Oct 23, 2018,

Re: ORDA Entity From

2018-10-23 Thread Douglas von Roeder via 4D_Tech
Chip: Uh, er, ah, yeah, I *could* but I'm thinking that it's such a trivial thing for 4D to expose it as a property of an entity that I'd rather wait till 4D adds it. The use case is to display an alert to the user than an entity is locked. 4D returns all sorts of info about the fact that it's

Re: ORDA Entity From

2018-10-23 Thread Chip Scheide via 4D_Tech
can you wrap the call to create the entity, tracking the detail(s) you want to track as you create the entity? On Tue, 23 Oct 2018 13:49:07 -0700, Douglas von Roeder via 4D_Tech wrote: > Neil: > > I asked, essentially, the same question yesterday and got no response. > > Given that ORDA is a

Re: ORDA Entity From

2018-10-23 Thread Douglas von Roeder via 4D_Tech
Neil: I asked, essentially, the same question yesterday and got no response. Given that ORDA is a work in progress, perhaps it will be added to the language. -- Douglas von Roeder 949-336-2902 On Tue, Oct 23, 2018 at 1:23 PM Dennis, Neil via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Is there

Re: ORDA - updating data in listboxes

2018-08-18 Thread Jeremy Roussak via 4D_Tech
Reminds me of sign in a lab: “CAUTION: do not look into laser with remaining eye”. Jeremy > On 13 Aug 2018, at 17:17, Two Way Communications via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > Looking on the bright side, this will elude you only ONCE ;-) >

Re: ORDA, 4D v17 & Training

2018-08-14 Thread Donna GALLIS via 4D_Tech
Hello everyone, This is my first submission, so please forgive me if the format is wrong or does not fit the topic. I’m the Field Marketing Manager for 4D, North America. I want to let everyone know we are hosting another 4D Essentials Training in October. For those developers who want to

Re: ORDA runtime error - seems like a bug in 4D

2018-08-13 Thread Jeffrey Kain via 4D_Tech
Awesome - thanks Add. > On Aug 13, 2018, at 4:17 PM, Add Komoncharoensiri > wrote: > > Hi Jeff, > > We just confirmed that this is a bug occurs in 4D Remote only. We'll get it > reported to the team. > > Regards, > Add **

Re: ORDA runtime error - seems like a bug in 4D

2018-08-13 Thread Add Komoncharoensiri via 4D_Tech
Hi Jeff, We just confirmed that this is a bug occurs in 4D Remote only. We'll get it reported to the team. Regards, Add  On 8/13/18, 10:27 AM, "4D_Tech on behalf of Jeffrey Kain via 4D_Tech" <4d_tech-boun...@lists.4d.com on behalf of 4d_tech@lists.4d.com> wrote: Forgot to add - it

Re: ORDA runtime error - seems like a bug in 4D

2018-08-13 Thread Jeffrey Kain via 4D_Tech
Also, it only fails in client/server. Single user is fine. > On Aug 13, 2018, at 3:47 PM, Jeffrey Kain wrote: > > Well, "Levy"+Char(Quote)+"s" had no effect. I'll download HF1 tonight, but I > didn't see anything documented in the fix notes like this.

Re: ORDA runtime error - seems like a bug in 4D

2018-08-13 Thread Jeffrey Kain via 4D_Tech
Well, "Levy"+Char(Quote)+"s" had no effect. I'll download HF1 tonight, but I didn't see anything documented in the fix notes like this. Thanks, Tim! Jeff ** 4D Internet Users Group (4D iNUG) Archive:

Re: ORDA runtime error - seems like a bug in 4D

2018-08-13 Thread Tim Nevels via 4D_Tech
On Aug 13, 2018, at 2:00 PM, Jeffrey Kain wrote: > This fails every time: > > C_OBJECT($selManuAbbv) > $tManufacturerName:="Levy's" > $selManuAbbv:=ds.ManufacturerAbbv.query("Manufacturer = > :1";$tManufacturerName) > > It's due to the single-quote in the string. Is this a bug in 4D? Did you

Re: ORDA runtime error - seems like a bug in 4D

2018-08-13 Thread Jeffrey Kain via 4D_Tech
Forgot to add - it fails as in 4D gives a runtime error every time trying to execute the query (this is from 4D Remote - haven't tried single user yet): Error code: 1806 (dbmg) URL is not well formed component: dbmg > On Aug 13, 2018, at 1:20 PM, Jeffrey Kain wrote: > > This fails

Re: ORDA - updating data in listboxes

2018-08-13 Thread Two Way Communications via 4D_Tech
Looking on the bright side, this will elude you only ONCE ;-) Rudy Mortier Two Way Communications bvba > On 13 Aug 2018, at 00:13, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote: > > This makes me wonder why REDRAW can't do this internally instead of adding > yet another microscopic

Re: ORDA - updating data in listboxes

2018-08-12 Thread Kirk Brooks via 4D_Tech
John, Agreed. It would be nice if REDRAW simply recognized what the object/parameter is and took appropriate action. On Sun, Aug 12, 2018 at 3:14 PM John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote: > This makes me wonder why REDRAW can't do this internally instead of adding > yet another

Re: ORDA - updating data in listboxes

2018-08-12 Thread John DeSoi via 4D_Tech
This makes me wonder why REDRAW can't do this internally instead of adding yet another microscopic difference between listbox types that will continue to elude even the most experienced 4D developers. At the very least, the REDRAW documentation should be updated to say that this command does

Re: ORDA - updating data in listboxes

2018-08-12 Thread Kirk Brooks via 4D_Tech
It is - thanks Spencer. I knew I'd read something about this recently I just couldn't recall where. Thanks! On Sun, Aug 12, 2018 at 12:05 PM Spencer Hinsdale via 4D_Tech < 4d_tech@lists.4d.com> wrote: > is this relevant? > > http://kb.4d.com/resources/inug?msgid=GmailId164f73d107b663e7 < >

Re: ORDA - updating data in listboxes

2018-08-12 Thread Spencer Hinsdale via 4D_Tech
is this relevant? http://kb.4d.com/resources/inug?msgid=GmailId164f73d107b663e7 > On Aug 12, 2018, at 11:55 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > The thing that's not working is the Name column of the

Re: ORDA question: how do I add related fields to an entity selection?

2018-08-01 Thread Chip Scheide via 4D_Tech
Tim, I have been creating a LOT of custom constants recently (removing IP vars used as constants) [sidebar - I am down to < 40 ipvars from over 550] Yes, it is a minor PITA to have to restart, but if you 'watch' the loading process 4D loads the custom constants BEFORE running almost everything

Re: ORDA question: how do I add related fields to an entity selection?

2018-08-01 Thread Tim Nevels via 4D_Tech
On Aug 1, 2018, at 9:49 AM, Jeremy French wrote: > Try creating 2-tables with a one-to-many relation. Say "Owner" (one table) > and "Item" (many table.) > In the Relation Inspector, name the relations: > > Many to one as "theOwner" > One to many as "theItems" > > Don't forget to restart 4D

Re: ORDA question: how do I add related fields to an entity selection?

2018-07-31 Thread Jeremy French via 4D_Tech
Hi Julio, Have you looked at: http://doc.4d.com/4Dv17/4D/17/dataClassAttributerelatedDataClass.303-3884018.en.html Relation attributes have 3-properties: 1) kind 2) name 3) relatedDataClass The "kind" property tells you the type of relation: one or many. The "name" property is the name you

Re: ORDA question: how do I add related fields to an entity selection?

2018-07-31 Thread Keisuke Miyako via 4D_Tech
I suppose it could be "nice" to have such a feature, indeed there were hints on the forums that it is in the pipeline, but I think it is important to stop and consider why the feature is not available at this point in time. code is never tokenised in ORDA. as developers, we should embrace it,

Re: ORDA question: how do I add related fields to an entity selection?

2018-07-31 Thread Julio Carneiro via 4D_Tech
Interesting Miyako, but that only tells me I have a relation attribute and that relation’s name. It does not tell me if it is a relations between A and B, or A and C. Is there a way to get that? And there is one key member function missing that tells me to which Table an Entity or Entity

Re: ORDA question: how do I add related fields to an entity selection?

2018-07-30 Thread Keisuke Miyako via 4D_Tech
or, DA. C_COLLECTION($one;$many) $one:=New collection $many:=New collection For each ($attribute;ds.Table_1) $kind:=ds.Table_1[$attribute].kind Case of : ($kind="storage") : ($kind="relatedEntity") $one.push($attribute) : ($kind="relatedEntities") $many.push($attribute) End case End for

Re: ORDA question: how do I add related fields to an entity selection?

2018-07-30 Thread Julio Carneiro via 4D_Tech
Thanks Lahav, that works. I’m using an Entity Selection to display on a Listbox and I needed to include some related field columns. Using relation names did the trick. This is all generic code written a long time ago and I’m upgrading it to V17+ORDA. As a thank you for the tip, here is some

RE: ORDA question: how do I add related fields to an entity selection?

2018-07-30 Thread lists via 4D_Tech
Hi Julio, You need to name your relations, which then shows up as an entity in your collection, containing the related data. Assuming a table named A and a relation to table B named My_B_Link, after loading a selection of table A into collection My_Col, you can get your related data from

Re: ORDA on switch?

2018-04-12 Thread Keith Culotta via 4D_Tech
The table must have a primary key field to be seen. The old table was created before primary keys were used. Keith - CDI > On Apr 12, 2018, at 10:33 AM, Keith Culotta wrote: > > C_OBJECT($entAll) > $entAll:=ds.Table_1.all() > > The code works in a new structure. > It

Re: ORDA query & pointers syntax question

2018-04-11 Thread Keith Culotta via 4D_Tech
Thanks! > On Apr 11, 2018, at 4:04 PM, Julio Carneiro via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > ooops, sorry I mixed up ‘classic 4D’ and ORDA :-) > > The query line should read: > > ds[$tableName].query($tableName+”.”+$fieldName+” = “+$aValue) > or >

Re: ORDA query & pointers syntax question

2018-04-11 Thread Julio Carneiro via 4D_Tech
ooops, sorry I mixed up ‘classic 4D’ and ORDA :-) The query line should read: ds[$tableName].query($tableName+”.”+$fieldName+” = “+$aValue) or ds[$tableName].query($tableName+”.”+$fieldName+” = :1“;$aValue) hth julio > On Apr 11, 2018, at 5:00 PM, Julio Carneiro wrote: > >

Re: ORDA query & pointers syntax question

2018-04-11 Thread Julio Carneiro via 4D_Tech
Something like this might do the trick (did not try it yet): $tableName:=Table name(pTable) $fieldName:=Field name(pField) QUERY(ds[$tableName];ds[$tableName][$fieldName]=$aValue) When an object property name is on a variable, you can use the “object[property]” syntax. hth julio > On Apr 11,

Re: ORDA query & pointers syntax question

2018-04-11 Thread Dani Beaubien via 4D_Tech
Hi Kieth, These are equivalent. C_OBJECT($medicaidEligibleStudentsInDistr) $medicaidEligibleStudentsInDistr:=ds.Student.query("Medicaid_Eligible = 'Yes' & District_ID = :1";$districID) $medicaidEligibleStudentsInDistr:=ds["Student"].query("Medicaid_Eligible = 'Yes' & District_ID =