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