Re: [Fun] Special Query ORDA Replacement

2021-03-21 Thread Jörg Knebel via 4D_Tech


> On 21 /03 /2021, at 13:51, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> the general idea is like this:

Thanks Keisuke, BUT next time I mark something with “FUN”, please don’t waste 
any time on anything.

Cheers
Jörg
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: [Fun] Special Query ORDA Replacement

2021-03-20 Thread Keisuke Miyako via 4D_Tech
the general idea is like this:

If (False)  //create sample data
ds.xFieldInfo.all().drop()

$exFieldInfo:=ds.xFieldInfo.new()
$exFieldInfo.TableIDRef:=Table(->[Table_1])
$exFieldInfo.FieldID:=Field(->[Table_1]Field_2)
$exFieldInfo.save()

$exFieldInfo:=ds.xFieldInfo.new()
$exFieldInfo.TableIDRef:=Table(->[Table_1])
$exFieldInfo.FieldID:=Field(->[Table_1]Field_3)
$exFieldInfo.save()

$exFieldInfo:=ds.xFieldInfo.new()
$exFieldInfo.TableIDRef:=Table(->[Table_1])
$exFieldInfo.FieldID:=Field(->[Table_1]Field_4)
$exFieldInfo.save()
End if

vtxtSearch1:="a"
vtxtSearch2:="b"
vtxtSearch3:="c"

$esxFieldInfo:=ds.xFieldInfo.all()

$count:=0
$criteria:=New collection
$params:=New object("attributes";New object;"parameters";New object)
For each ($exFieldInfo;$esxFieldInfo)
$count:=$count+1
$parameter:="vtxtSearch"+String($count)
$searchptr:=Get pointer($parameter)
If (Value type($searchptr->)=Is text)
If ($searchptr->#"")
$attribute:=Field name($exFieldInfo.TableIDRef;$exFieldInfo.FieldID)
$params.attributes[$attribute]:=$attribute
$params.parameters[$parameter]:=$searchptr->
$criterium:=":"+$attribute+" == :"+$parameter
$criteria.push($criterium)
End if
End if
End for each

vptrCurrentTable:=->[Table_1]

$es:=ds[Table name(vptrCurrentTable)].query($criteria.join(" and ");$params)

---

when you call query(),

$criteria would contain

[:Field_2 == :vtxtSearch1,:Field_3 == :vtxtSearch2,:Field_4 == :vtxtSearch3]

$params would contain

{attributes:{Field_2:Field_2,Field_3:Field_3,Field_4:Field_4},parameters:{vtxtSearch1:a,vtxtSearch2:b,vtxtSearch3:c}}

---

for more info see:

https://doc.4d.com/4Dv18/4D/18.4/dataClassquery.305-5233999.en.html
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

[Fun] Special Query ORDA Replacement

2021-03-20 Thread Jörg Knebel via 4D_Tech
G’day,

Just out of my dirty and provocative soul… - have fun :o)

How would be the ORDA-Replacement look like for the following scenario?:

The administrator of a 4D-database is able to set/change the number and the 
order of the fields of ALL tables a common user can search in at any time 
without re-compiling.

Meaning the Query is constructed with the “;*" parameter.

/QUERY Construction

$count:=1

Repeat // start “collecting" Query parameters

$searchptr:=Get pointer("vtxtSearch"+String($count))
If ((Not(Is nil pointer($searchptr))) & ($searchptr->#""))
SU_SearchTable 
(Field([xFieldInfo]TableIDRef;[xFieldInfo]FieldID);$searchptr). // Get info for 
the current table
End if 
$count:=$count+1
NEXT RECORD([xFieldInfo])

Until (End selection([xFieldInfo]))

\QUERY Construction

QUERY(vptrCurrentTable->) // Execute Query 


Cheers
Jörg

**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using the length parameter in a ORDA query.

2020-04-27 Thread Peter Bozek via 4D_Tech
On Mon, Apr 27, 2020 at 8:19 PM Eric Naujock  wrote:

> Thanks Peter.
> That could be considered but the part I asked about was only part of the
> query, In reality it had more parts to the query. Where essayWordCount is
> an long integer.
>
> $records:= ds.Parent.query (“essayWordCount >100 and
> parentReference_return #null)
>

Eric,

yes, that was clear that this is just simpified case, but still, cannot you
use something like

records:=ds.Children.query(essayWordCount >100 &
otherChildCondition).parentReference.query("conditions for parent...")

Peter Bozek


>
> I have one monster query that is generated by concatenating strings to
> build the query part and Objects creating the parameters passed to the
> query.
>
> I have used code like you example in my parking lot function.
>
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using the length parameter in a ORDA query.

2020-04-27 Thread Eric Naujock via 4D_Tech
Thanks Peter.
That could be considered but the part I asked about was only part of 
the query, In reality it had more parts to the query. Where essayWordCount is 
an long integer.

$records:= ds.Parent.query (“essayWordCount >100 and parentReference_return 
#null)

I have one monster query that is generated by concatenating strings to build 
the query part and Objects creating the parameters passed to the query.

I have used code like you example in my parking lot function.

> On Apr 27, 2020, at 2:08 PM, Peter Bozek  wrote:
> 
> 
> 
> On Mon, Apr 27, 2020 at 6:54 PM Eric Naujock via 4D_Tech 
> <4d_tech@lists.4d.com > wrote:
> I am trying to preform an unusual query. I em effectively thing to find all 
> the records in a parent where the parent has children. Any suggestions other 
> than build a collection of records primary keys and use an “in” conditional. 
> Which feels dirty.
> 
> 
> This this case I have a table “cases” with records and a Child table with 
> records. There is a one to many relationship from child to parent with a 
> return path of “childReference_return” I am looking for all the parents who 
> have children. There is more to the query but I am only looking at this 
> parent child element.
> 
> Not sure if I understand it, but why not to select all children and map them 
> to parents?  You would have something like this:
> 
> $records:=ds.Children.all().parentReference
> 
> where parentReference is name of relation from Children to Parents tables.
> 
> HTH,
> 
> Peter Bozek
> 
> 
>  
> 
> 
> I have tried using something like.
> 
> $records:=ds.Parents.query (“childReference_return.length>0”)
> 
> But when I do this I get null back. 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html 
> 
> Options: https://lists.4d.com/mailman/options/4d_tech 
> 
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com 
> 
> **
> 
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using the length parameter in a ORDA query.

2020-04-27 Thread Peter Bozek via 4D_Tech
On Mon, Apr 27, 2020 at 6:54 PM Eric Naujock via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am trying to preform an unusual query. I em effectively thing to find
> all the records in a parent where the parent has children. Any suggestions
> other than build a collection of records primary keys and use an “in”
> conditional. Which feels dirty.
>
>
> This this case I have a table “cases” with records and a Child table with
> records. There is a one to many relationship from child to parent with a
> return path of “childReference_return” I am looking for all the parents who
> have children. There is more to the query but I am only looking at this
> parent child element.
>

Not sure if I understand it, but why not to select all children and map
them to parents?  You would have something like this:

$records:=ds.Children.all().parentReference

where parentReference is name of relation from Children to Parents tables.

HTH,

Peter Bozek



>
>
> I have tried using something like.
>
> $records:=ds.Parents.query (“childReference_return.length>0”)
>
> But when I do this I get null back.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using the length parameter in a ORDA query.

2020-04-27 Thread Eric Naujock via 4D_Tech
Lahav Thanks for the feedback. 
After writing up the question and sending it I tried to do a query 
where I just wanted to get all the parents when there is a child. It turns out 
the trick was to think a bit odd about the question.

If you query under ORDA and there is no result you get “null” back, instead of 
an empty set.  Using this Idea I tried to do the query like this.

$records:=ds.Parents.query (“childReference_return # null”)

This gives me a list of exactly what I want. Of course I can’t check directly 
to see if there is more than a quantity of children, but for what I need it was 
good enough. I think to check for a quantity of children I would have to likely 
use an eval.

> On Apr 27, 2020, at 1:00 PM, lists via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Take a look at FORMULA and eval() syntax in queries...
> 
> Lahav
> 
> -Original Message-
> From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Eric Naujock via 
> 4D_Tech
> Sent: Monday, April 27, 2020 10:54 AM
> To: Technical iNug 4D <4d_tech@lists.4D.com>
> Cc: Eric Naujock 
> Subject: Using the length parameter in a ORDA query.
> 
> I am trying to preform an unusual query. I em effectively thing to find all 
> the records in a parent where the parent has children. Any suggestions other 
> than build a collection of records primary keys and use an “in” conditional. 
> Which feels dirty.
> 
> 
> This this case I have a table “cases” with records and a Child table with 
> records. There is a one to many relationship from child to parent with a 
> return path of “childReference_return” I am looking for all the parents who 
> have children. There is more to the query but I am only looking at this 
> parent child element.
> 
> 
> 
> I have tried using something like.
> 
> $records:=ds.Parents.query (“childReference_return.length>0”)
> 
> But when I do this I get null back. 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Using the length parameter in a ORDA query.

2020-04-27 Thread lists via 4D_Tech
Take a look at FORMULA and eval() syntax in queries...

Lahav

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Eric Naujock via 
4D_Tech
Sent: Monday, April 27, 2020 10:54 AM
To: Technical iNug 4D <4d_tech@lists.4D.com>
Cc: Eric Naujock 
Subject: Using the length parameter in a ORDA query.

I am trying to preform an unusual query. I em effectively thing to find all the 
records in a parent where the parent has children. Any suggestions other than 
build a collection of records primary keys and use an “in” conditional. Which 
feels dirty.


This this case I have a table “cases” with records and a Child table with 
records. There is a one to many relationship from child to parent with a return 
path of “childReference_return” I am looking for all the parents who have 
children. There is more to the query but I am only looking at this parent child 
element.



I have tried using something like.

$records:=ds.Parents.query (“childReference_return.length>0”)

But when I do this I get null back. 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Using the length parameter in a ORDA query.

2020-04-27 Thread Eric Naujock via 4D_Tech
I am trying to preform an unusual query. I em effectively thing to find all the 
records in a parent where the parent has children. Any suggestions other than 
build a collection of records primary keys and use an “in” conditional. Which 
feels dirty.


This this case I have a table “cases” with records and a Child table with 
records. There is a one to many relationship from child to parent with a return 
path of “childReference_return” I am looking for all the parents who have 
children. There is more to the query but I am only looking at this parent child 
element.



I have tried using something like.

$records:=ds.Parents.query (“childReference_return.length>0”)

But when I do this I get null back. 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V18 ORDA — What is the Best substitution option for BLOB fields

2020-04-24 Thread Peter Bozek via 4D_Tech
Look at BASE64 ENCODE / DECODE

https://doc.4d.com/4Dv17/4D/17.4/BASE64-DECODE.301-4882388.en.html

Peter Bozek


On Fri, Apr 24, 2020 at 9:05 AM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ORDA does not support BLOB fields. So I need a different way of storing
> things that would normally be BLOBS as TEXT.
> (in particular, system DOCUMENTS such as PDFS, JPGS, etc).
>
> I am trying to work-around by converting BLOB -> TEXT -> BLOB
> 
> The key statements to work around the ‘BLOB’ problem are:
> $en_Lib.UpdBLOBText:=Convert to text($blob_File;"UTF-16")   // To save
> the BLOB as a TEXT field
>
> CONVERT FROM TEXT([Lib]UpdBLOBText;"UTF-16";$Blob)  // to
> convert the TEXT back into a BLOB, so it can be written as a system document
> 
>
> I am not actually storing the documents in the database, but wanting to
> have a mechanism to ‘transport’ a document to the 4D Server so it can
> manage the document creation ‘on disk’ in the TRIGGER. Basically, I am
> managing a ‘LIBRARY’ of documents that are stored on the machine hosting 4D
> Server.
>
> My methodology seems to works fine:
>
> EXPLANATION:
> • on CLIENT:   Document is read from Disk [as a BLOB], converted to a TEXT
> field and SAVED.  [Lib]
> • on 4D SERVER: In the [Lib] Trigger method, if there are contents in
> [Lib]UpdBLOBText, then the update is made in the document library
> then, the [Lib]UpdBLOBText field is BLANKED OUT so reduce data
> size, obviously.
>
> // ON THE CLIENT MACHINE:
> // READ THE CONTENTS OF A FILE FROM DISK, STORING IT INTO THE
> [Lib]UpdBLOBText field to be processed by its TRIGGER on SAVE
>
> $droppedFile is a FILE OBJECT made withFile( path ). The object is
> good. I use the ‘Folder’ methodology:
> $blob_File:=$droppedFile.getContent()   //
> get the contents of the disk file as a BLOB (which was dropped onto a drop
> variable)
> $en_Lib.UpdBLOBText:=Convert to text($blob_File;"UTF-16")   // update
> this to the UpdBLOBText.
>
>
> // WHEN A [Lib] RECORD IS SAVED, THEN IN THE [Lib] TRIGGER the following
> is done on the 4D Server machine:
> //
> …..
>
> $theFile:=File(Storage.folder_docLibrary.path+$localPath)   //
> set up the DESTINATION ON DISK for this file
> CONVERT FROM TEXT([Lib]UpdBLOBText;"UTF-16";$Blob)  // convert
> the TEXT back into a BLOB
> $theFile.setContent($Blob)
>   // deposit the BLOB into the disk File
> [Lib]UpdBLOBText:=“”
>   // CLEAR OUT ITS CONTENTS
>
> 
>
> For a number of file types, this works fine. But for MS Word documents I
> get a warning when I open them up:
> "Word found unreadable content in "2002001A Permit 1 Chris Belanger
> IS-821A.docx". Do you want to recover the contents of this document? If you
> trust the source of this document, click Yes.”
>
> When I Click YES, the document appears to be fine: no visible mess-up.
> But I suspect my BLOB Work-Around is messing with the file contents in
> some way.
>
> What are the best parameters to use for converting BLOB -> TEXT -> BLOB ?
>
> Thanks,
> Chris
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
--

Peter Bozek
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

V18 ORDA — What is the Best substitution option for BLOB fields

2020-04-24 Thread Chris Belanger via 4D_Tech
ORDA does not support BLOB fields. So I need a different way of storing things 
that would normally be BLOBS as TEXT.
(in particular, system DOCUMENTS such as PDFS, JPGS, etc).

I am trying to work-around by converting BLOB -> TEXT -> BLOB

The key statements to work around the ‘BLOB’ problem are:
$en_Lib.UpdBLOBText:=Convert to text($blob_File;"UTF-16")   // To save the 
BLOB as a TEXT field

CONVERT FROM TEXT([Lib]UpdBLOBText;"UTF-16";$Blob)  // to convert 
the TEXT back into a BLOB, so it can be written as a system document


I am not actually storing the documents in the database, but wanting to have a 
mechanism to ‘transport’ a document to the 4D Server so it can manage the 
document creation ‘on disk’ in the TRIGGER. Basically, I am managing a 
‘LIBRARY’ of documents that are stored on the machine hosting 4D Server.

My methodology seems to works fine:

EXPLANATION:
• on CLIENT:   Document is read from Disk [as a BLOB], converted to a TEXT 
field and SAVED.  [Lib]
• on 4D SERVER: In the [Lib] Trigger method, if there are contents in 
[Lib]UpdBLOBText, then the update is made in the document library
then, the [Lib]UpdBLOBText field is BLANKED OUT so reduce data size, 
obviously.

// ON THE CLIENT MACHINE:  
// READ THE CONTENTS OF A FILE FROM DISK, STORING IT INTO THE [Lib]UpdBLOBText 
field to be processed by its TRIGGER on SAVE

$droppedFile is a FILE OBJECT made withFile( path ). The object is good. I 
use the ‘Folder’ methodology:
$blob_File:=$droppedFile.getContent()   // get 
the contents of the disk file as a BLOB (which was dropped onto a drop variable)
$en_Lib.UpdBLOBText:=Convert to text($blob_File;"UTF-16")   // update this 
to the UpdBLOBText.


// WHEN A [Lib] RECORD IS SAVED, THEN IN THE [Lib] TRIGGER the following is 
done on the 4D Server machine:
// 
…..

$theFile:=File(Storage.folder_docLibrary.path+$localPath)   // set 
up the DESTINATION ON DISK for this file 
CONVERT FROM TEXT([Lib]UpdBLOBText;"UTF-16";$Blob)  // convert the 
TEXT back into a BLOB
$theFile.setContent($Blob)  
// deposit the BLOB into the disk File
[Lib]UpdBLOBText:=“”
// CLEAR OUT ITS CONTENTS



For a number of file types, this works fine. But for MS Word documents I get a 
warning when I open them up:
"Word found unreadable content in "2002001A Permit 1 Chris Belanger 
IS-821A.docx". Do you want to recover the contents of this document? If you 
trust the source of this document, click Yes.”

When I Click YES, the document appears to be fine: no visible mess-up.
But I suspect my BLOB Work-Around is messing with the file contents in some way.

What are the best parameters to use for converting BLOB -> TEXT -> BLOB ?

Thanks,
Chris

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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!
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.4d.fr_fixedbugslist-3Fbranch-3D18=DwIGaQ=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=ggnhy3XDlkr8p1pxOv3hyMunBXkdyaEyaszahWyKNa0=1xZu-0iJ4fTIcHlhB7HherXwFSgpEXOgliSS_rrTOZo=fstIKyWWsQ3uUtOwarjg_bNqSq_aZI_FNx5LS97cons=
> 
> #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.
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.4d.com_archives.html=DwIGaQ=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=ggnhy3XDlkr8p1pxOv3hyMunBXkdyaEyaszahWyKNa0=1xZu-0iJ4fTIcHlhB7HherXwFSgpEXOgliSS_rrTOZo=4bHRMQlBpcz9y-clTxj9MYXH6_U2VoSympPVZZojDeo=
> Options: 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.4d.com_mailman_options_4d-5Ftech=DwIGaQ=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM=ggnhy3XDlkr8p1pxOv3hyMunBXkdyaEyaszahWyKNa0=1xZu-0iJ4fTIcHlhB7HherXwFSgpEXOgliSS_rrTOZo=x11-tTwpOA2O5C2ub0xcMkELt-qJmRbUDyi1pcoySjY=
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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)
$esTable_1:=ds.Table_1.query("Field_2 IN :1";New collection;$params)

{"item":"Constant Value: "}

---

the inverse of FALSE is TRUE, but the inverse of NULL is NULL.

it's counter-intuitive, but that how NULL works.

> On Mar 4, 2020, at 1:02, Tom Buckler  wrote:
> 
> I think you are on to something, since 
> 
>(entityUUID IN []) 
>NOT(entityUUID IN [])
> both return the same results.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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"… I've not tested this 
behavior when compiled.

Left to ponder: is it a bug or a feature?  Either way I'm not seeing it as 
"appropriate". 



> On Mar 3, 2020, at 3:57 AM, Adrian Boone via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> 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 collection of 
> UUIDs from another ORDA query, so I just add a garbage UUID, but I guess even 
> adding an empty string would do the trick?
> 
> Adrian
> 
> On 03/03/2020 08:52, Keisuke Miyako via 4D_Tech wrote:
>> 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 equation.
>> any string of any length that matches an empty string according to unicode 
>> collation for the current locale rules is a match.
>> control characters, non characters, etc. that are not identical to "" can 
>> still be equivalent to "".
>> such entities must be removed from the resulting entity selection in this 
>> case because of the "NOT".
>>  
>>> On Mar 3, 2020, at 17:26, Douglas Cryer via 4D_Tech <4d_tech@lists.4d.com> 
>>> wrote:
>>> 
>>> Re:
>>> Why is my query of
>>>NOT(IN [])
>>>   versus
>>>NOT(IN [""])
>>> producing difference results?
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 something different
$vc_exclude:=New collection //make a simple empty collection
If($vc_exclude.length>0)
$es_MySel:=ds.myTable.query("not(myField in :1)";$vc_exclude)// Could 
have other fields as well
Else
$es_MySel:=ds.myTable.all() //Or a query without the no in
End If

Option 2 - Add a fixer value to the collection
$vc_exclude:=New collection //make a simple empty collection
If($vc_exclude.length=0)
$vc_exclude.push("")// Add a value to the collection that I would never 
expect to find (of the right type)
End If
$es_MySel:=ds.myTable.query("not(myField in :1)";$vc_exclude)// now the query 
will work

Option 3 - take the in away from the query
$vc_exclude:=New collection //make a simple empty collection
$es_MySel:=ds.myTable.all().minus(ds.myTable.query("myField in 
:1";$vc_exclude)// now the query will work

The .all() above could be the a .query() if you are trying to query on multiple 
properties.

Personally I like option 3 best.

Regards,  Dougie


telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com  Web : http://www.telekinetix.com 


 




**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 collection of UUIDs from another ORDA query, so I just add a 
garbage UUID, but I guess even adding an empty string would do the trick?


Adrian

On 03/03/2020 08:52, Keisuke Miyako via 4D_Tech wrote:

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 equation.
any string of any length that matches an empty string according to unicode 
collation for the current locale rules is a match.
control characters, non characters, etc. that are not identical to "" can still be 
equivalent to "".
such entities must be removed from the resulting entity selection in this case because of 
the "NOT".
  

On Mar 3, 2020, at 17:26, Douglas Cryer via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

Re:
Why is my query of
NOT(IN [])
   versus
NOT(IN [""])
producing difference results?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 equation.
any string of any length that matches an empty string according to unicode 
collation for the current locale rules is a match.
control characters, non characters, etc. that are not identical to "" can still 
be equivalent to "".
such entities must be removed from the resulting entity selection in this case 
because of the "NOT".
 
> On Mar 3, 2020, at 17:26, Douglas Cryer via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Re:
> Why is my query of
>NOT(IN [])
>   versus
>NOT(IN [""])
> producing difference results?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 was zero I had to do something else.  4D will 
probably say feature but I say annoying.

Regards,  Dougie


telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com  Web : http://www.telekinetix.com 







**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 difference results?

Tom



> On Mar 1, 2020, at 5:18 PM, Jeremy French  wrote:
> 
> 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 
> 
> 
> Best regards,
> Jeremy French
> 
> 
> 
> 
>> On Mar 1, 2020, at 2:05 PM, Tom-Lists via 4D_Tech <4d_tech@lists.4d.com 
>> > wrote:
>> 
>> Now assuming that the field "entityUUID" is populated (no null values), How 
>> come I get different results with:
>> 
>> $vC_uuidsToIgnore:=New collection()
>> $deletes:=ds.SyncDeletes.query("NOT(entityUUID IN :1)";$vC_uuidsToIgnore)
>>  $deletes --> zero length entitySelection (not what I expect!)
>> 
>> versus
>> $vC_uuidsToIgnore:=New collection("")
>> $deletes:=ds.SyncDeletes.query("NOT(entityUUID IN :1)";$vC_uuidsToIgnore)
>>  $deletes --> all SyncDeletes records (good!)
>> 
>> The ONLY difference between the above snippets is that one collection is 
>> empty versus the other has a single empty value.
>> 
>> v18.0 
>> 
>> I can exclude uuids when my vC_uuidsToIgnore contains one or more UUID's, 
>> the problem appears when that collection is empty… I should get ALL 
>> SyncDeletes records.
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 


Best regards,
Jeremy French




> On Mar 1, 2020, at 2:05 PM, Tom-Lists via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Now assuming that the field "entityUUID" is populated (no null values), How 
> come I get different results with:
> 
> $vC_uuidsToIgnore:=New collection()
> $deletes:=ds.SyncDeletes.query("NOT(entityUUID IN :1)";$vC_uuidsToIgnore)
>   $deletes --> zero length entitySelection (not what I expect!)
> 
> versus
> $vC_uuidsToIgnore:=New collection("")
> $deletes:=ds.SyncDeletes.query("NOT(entityUUID IN :1)";$vC_uuidsToIgnore)
>   $deletes --> all SyncDeletes records (good!)
> 
> The ONLY difference between the above snippets is that one collection is 
> empty versus the other has a single empty value.
> 
> v18.0 
> 
> I can exclude uuids when my vC_uuidsToIgnore contains one or more UUID's, the 
> problem appears when that collection is empty… I should get ALL SyncDeletes 
> records.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ORDA - NOT(IN)

2020-03-01 Thread Tom-Lists via 4D_Tech
Hi All,
I'm generally in love with ORDA, but:

Now assuming that the field "entityUUID" is populated (no null values), How 
come I get different results with:

$vC_uuidsToIgnore:=New collection()
$deletes:=ds.SyncDeletes.query("NOT(entityUUID IN :1)";$vC_uuidsToIgnore)
$deletes --> zero length entitySelection (not what I expect!)

versus
$vC_uuidsToIgnore:=New collection("")
$deletes:=ds.SyncDeletes.query("NOT(entityUUID IN :1)";$vC_uuidsToIgnore)
$deletes --> all SyncDeletes records (good!)

The ONLY difference between the above snippets is that one collection is empty 
versus the other has a single empty value.

v18.0 

I can exclude uuids when my vC_uuidsToIgnore contains one or more UUID's, the 
problem appears when that collection is empty… I should get ALL SyncDeletes 
records.


Cheers
Tom





Tom Buckler | Buckler Microelectronics Inc.
17008 - 90 Avenue NW | Suite 272 | Edmonton | AB | Canada | T5T 1L6
Cell: (780) 499-5525 




**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using ORDA - getting ONE entity from MANY Table

2020-01-29 Thread UKVetDerm via 4D_Tech
Thanks
Re: Just keep in mind, if you rename a field or relation, you must restart the 
database before you can use those renamed fields or relations.
I am sorted from the previous answer and strongly suspect it was this that 
caught me out, or I was having a decidedly off day.
Steve

On 29/01/2020, 13:43, "4D_Tech on behalf of James Crate via 4D_Tech" 
<4d_tech-boun...@lists.4d.com on behalf of 4d_tech@lists.4d.com> wrote:

In the debugger, look at your “emp” entity. It will show you the fields 
*and* relations. Just use the name it shows for the relation, I.e. 

$text:=$emp.Text

and then access fields on $text like any other entity, or you can access 
the related one field directly.

$description:=$emp.Text.description

Just keep in mind, if you rename a field or relation, you must restart the 
database before you can use those renamed fields or relations.

Jim Crate


On Jan 28, 2020, at 4:25 AM, UKVetDerm via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Hi ORDA users
> 
> I am starting to explore ORDA and with many false steps I have reduced 
some code to just a few lines which is great. However, I am struggling to 
extract a field from a related one table when working principally in the many 
table.
> 
> 
> In the following selection – I cannot find the code to extract the field 
value from a related one table (Events is the many table) – I am building a 
calendar view with hmCal.
> 
> I have named my relation and looked at the various examples and cheat 
sheets and just can’t get to grips with this.
> 
> 
    > 
> 4D there would be a good place for a 4D ORDA manual like when SQL was 
introduced for those of us that are not full time at this!
> 
> 
> 
> I am sure I am missing something very obvious so any suggestions would be 
gratefully received!
> 
> 
> 
> Thanks
> 
> 
> 
> Steve
> 
> UKVD
> 
> 
> 
> 
--
> 
> 
> 
> C_OBJECT(emp)
> 
> 
> 
> For each (emp;ds.Events.query("StartDate > :1 & StartDate < :2 & Calendar 
= :3";vMondaydate;vMondayDate2;True)
> 
> $text:= a related one value!
> 
> $err:=hmCal_Add Appointment 
(calarea;emp.AppointmentNumber;$text;emp.MainContact 
emp.AllDay;emp.StartDate;emp.StartTime;emp.FinishDate;emp.FinishTime;0)
> 
>Blah blah …
> 
> End for each
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using ORDA - getting ONE entity from MANY Table

2020-01-29 Thread James Crate via 4D_Tech
In the debugger, look at your “emp” entity. It will show you the fields *and* 
relations. Just use the name it shows for the relation, I.e. 

$text:=$emp.Text

and then access fields on $text like any other entity, or you can access the 
related one field directly.

$description:=$emp.Text.description

Just keep in mind, if you rename a field or relation, you must restart the 
database before you can use those renamed fields or relations.

Jim Crate


On Jan 28, 2020, at 4:25 AM, UKVetDerm via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi ORDA users
> 
> I am starting to explore ORDA and with many false steps I have reduced some 
> code to just a few lines which is great. However, I am struggling to extract 
> a field from a related one table when working principally in the many table.
> 
> 
> In the following selection – I cannot find the code to extract the field 
> value from a related one table (Events is the many table) – I am building a 
> calendar view with hmCal.
> 
> I have named my relation and looked at the various examples and cheat sheets 
> and just can’t get to grips with this.
> 
> 
> 
> 4D there would be a good place for a 4D ORDA manual like when SQL was 
> introduced for those of us that are not full time at this!
> 
> 
> 
> I am sure I am missing something very obvious so any suggestions would be 
> gratefully received!
> 
> 
> 
> Thanks
> 
> 
> 
> Steve
> 
> UKVD
> 
> 
> 
> --
> 
> 
> 
> C_OBJECT(emp)
> 
> 
> 
> For each (emp;ds.Events.query("StartDate > :1 & StartDate < :2 & Calendar = 
> :3";vMondaydate;vMondayDate2;True)
> 
> $text:= a related one value!
> 
> $err:=hmCal_Add Appointment 
> (calarea;emp.AppointmentNumber;$text;emp.MainContact 
> emp.AllDay;emp.StartDate;emp.StartTime;emp.FinishDate;emp.FinishTime;0)
> 
>Blah blah …
> 
> End for each
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using ORDA - getting ONE entity from MANY Table

2020-01-28 Thread Jeremy Roussak via 4D_Tech
Steve,

I’m new to ORDA as well, but I think the syntax you want is something like this

$text:=emp.relationToOneTable.oneTableFieldName

Jeremy

> On 28 Jan 2020, at 09:25, UKVetDerm via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi ORDA users
> 
> I am starting to explore ORDA and with many false steps I have reduced some 
> code to just a few lines which is great. However, I am struggling to extract 
> a field from a related one table when working principally in the many table.
> 
> 
> In the following selection – I cannot find the code to extract the field 
> value from a related one table (Events is the many table) – I am building a 
> calendar view with hmCal.
> 
> I have named my relation and looked at the various examples and cheat sheets 
> and just can’t get to grips with this.
> 
> 
> 
> 4D there would be a good place for a 4D ORDA manual like when SQL was 
> introduced for those of us that are not full time at this!
> 
> 
> 
> I am sure I am missing something very obvious so any suggestions would be 
> gratefully received!
> 
> 
> 
> Thanks
> 
> 
> 
> Steve
> 
> UKVD
> 
> 
> 
> --
> 
> 
> 
> C_OBJECT(emp)
> 
> 
> 
> For each (emp;ds.Events.query("StartDate > :1 & StartDate < :2 & Calendar = 
> :3";vMondaydate;vMondayDate2;True)
> 
> $text:= a related one value!
> 
> $err:=hmCal_Add Appointment 
> (calarea;emp.AppointmentNumber;$text;emp.MainContact 
> emp.AllDay;emp.StartDate;emp.StartTime;emp.FinishDate;emp.FinishTime;0)
> 
>Blah blah …
> 
> End for each
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Using ORDA - getting ONE entity from MANY Table

2020-01-28 Thread UKVetDerm via 4D_Tech
Hi ORDA users

I am starting to explore ORDA and with many false steps I have reduced some 
code to just a few lines which is great. However, I am struggling to extract a 
field from a related one table when working principally in the many table.


In the following selection – I cannot find the code to extract the field value 
from a related one table (Events is the many table) – I am building a calendar 
view with hmCal.

I have named my relation and looked at the various examples and cheat sheets 
and just can’t get to grips with this.



4D there would be a good place for a 4D ORDA manual like when SQL was 
introduced for those of us that are not full time at this!



I am sure I am missing something very obvious so any suggestions would be 
gratefully received!



Thanks



Steve

UKVD



--



C_OBJECT(emp)



For each (emp;ds.Events.query("StartDate > :1 & StartDate < :2 & Calendar = 
:3";vMondaydate;vMondayDate2;True)

 $text:= a related one value!

$err:=hmCal_Add Appointment 
(calarea;emp.AppointmentNumber;$text;emp.MainContact 
emp.AllDay;emp.StartDate;emp.StartTime;emp.FinishDate;emp.FinishTime;0)

Blah blah …

End for each





**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> I have a form that is using a dialog method and is using first, last, 
> previous, and last to walk though a record in a form. When I use the 
> previous, next etc method from the form it properly moves between the records 
> in the EntitySelection as far the the Form. Variables go. But I have several 
> elements that are static variables that reflect items pointed to by the Form. 
> But when the Form data changes I hav nothing to tell me to update my process 
> variables being displayed in the form. Is there a way get an event that tells 
> my process variables to update?
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ORDA previous and next win a form.

2020-01-17 Thread Eric Naujock via 4D_Tech
I have a form that is using a dialog method and is using first, last, previous, 
and last to walk though a record in a form. When I use the previous, next etc 
method from the form it properly moves between the records in the 
EntitySelection as far the the Form. Variables go. But I have several elements 
that are static variables that reflect items pointed to by the Form. But when 
the Form data changes I hav nothing to tell me to update my process variables 
being displayed in the form. Is there a way get an event that tells my process 
variables to update?
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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.  "Self" was changed to "Get Edited Text" so the listbox 
changes after each keystroke, and ended up with this:

Case of 
: (Form event code=On After Edit)
$text:=Get edited text
If ($text#"")
$obj:=New 
object("$wordList";$text;"$fieldName";"Name";"$tableName";"Client")
$ents:=ORDA_WordQuery ($obj) // returns an entity 
selection, match if field contains all @words@
If ($ents#Null)
ents:=$ents.r_Contracts
End if 
End if 
End case 
// The ents entity selection is Contracts.  $ents is a Client entity selection. 
 The text entry area expects a Client name.


ORDA handles the problems solved by SET AUTOMATIC RELATIONS in both the input 
and output forms really well.  It is also flexible in terms of writing generic 
code.  You are right about pointers not being useful when trying to point to 
parts of an Entity.  

Christian, 
in your example:
  $clients:=ds.Client.query("Name = :1";"@"+Self->+"@")
  $contracts:=$clients.Contracts
is ".Contracts" meant to be the Table's name or is it meant to be the Link's 
name?

Thanks, Keith - CDI

> On Dec 6, 2019, at 10:04 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> 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 - though you don't need the step of converting to
> and from the array:
> 
> $clients:=ds.Client.query("Name = :1";"@"+Self->+"@")
> $col:=$clients.distinct("PriKey")
> EntSel:=ds.Contract.query("to_Client IN :1";$col)
> 
> By definition the PriKey should be distinct already but there's no downside
> to the command and it will also work for non-distinct values so it's a good
> habit to develop.
> 
> I would shorten it to a single query line:
> 
> $col:=ds.Client.query("Name = :1";"@"+Self->+"@") .distinct("PriKey")
> EntSel:=ds.Contract.query("to_Client IN :1";$col)
> 
> 
> This doesn't throw an error if the query is empty. And it's two lines of
> code to replace 7.
> 
> I infer you are retro fitting this ORDA code into an existing form because
> of using Self and a process var for EntSel. My experience so far is this is
> the less optimal way to implement ORDA. First, classic 4D is probably doing
> just fine for this chore so carry on with what you've got. Introducing ORDA
> in cases like that usually don't work out great. Your example sort of makes
> this point - if you start thinking the way to solve an ORDA problem is to
> start converting back and forth between arrays you are probably missing
> something new you should be using.
> 
> For UI stuff like this that means the object referenced by Self will
> ultimately be better handled if you begin using Form. I like to start from
> scratch when  convert a form: make a new blank form. Copy in the most basic
> elements of it and learn to set it up using Form. You will know you're
> doing it right when you stop needing to rely on pointers (especially Self)
> and process variables to manage forms. I stress "rely on" here. Self is
> useful but if you are using ORDA it's the last resort, never the first.
> Process vars have a place but rarely - very rarely - for managing a modern
> 4D form. Learn to use Form instead.
> 
> Once you have the basics working, (opening, closing, moving around,
> populating static or semi static objects) start adding in the other
> functionality. As you do that think about what you trying to accomplish -
> what is goal and purpose of the list, listbox, subform, etc. you are adding
> in. And how do you accomplish that with ORDA. This is important because
> whatever that task is accomplishing it with ORDA will nearly always be a
> completely different workflow from accomplishing it in classic 4D. If you
> simply paste in what you've been doing it's not going to really change
> anything. And if you don't want to really change anything what's the point
> of converting to ORDA?
> 
> By putting this into a brand new form you e

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 RELATE MANY SELECTION

For example if you have [Company] table and [Employee] table if the one to many 
link from company to employee is named "employees"... then you can do the 
following:

$employeeES:=ds.Company.all().employees

$employeeES will be an entity selection of all employees that have a company 
record.

Neil








--

Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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
christian.sakow...@heubach-media.de
Tel: +49/(0)40/41 455 455





> Am 06.12.2019 um 17:04 schrieb Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>:
> 
> 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 - though you don't need the step of converting to
> and from the array:
> 
> $clients:=ds.Client.query("Name = :1";"@"+Self->+"@")
> $col:=$clients.distinct("PriKey")
> EntSel:=ds.Contract.query("to_Client IN :1";$col)
> 
> By definition the PriKey should be distinct already but there's no downside
> to the command and it will also work for non-distinct values so it's a good
> habit to develop.
> 
> I would shorten it to a single query line:
> 
> $col:=ds.Client.query("Name = :1";"@"+Self->+"@") .distinct("PriKey")
> EntSel:=ds.Contract.query("to_Client IN :1";$col)
> 
> 
> This doesn't throw an error if the query is empty. And it's two lines of
> code to replace 7.
> 
> I infer you are retro fitting this ORDA code into an existing form because
> of using Self and a process var for EntSel. My experience so far is this is
> the less optimal way to implement ORDA. First, classic 4D is probably doing
> just fine for this chore so carry on with what you've got. Introducing ORDA
> in cases like that usually don't work out great. Your example sort of makes
> this point - if you start thinking the way to solve an ORDA problem is to
> start converting back and forth between arrays you are probably missing
> something new you should be using.
> 
> For UI stuff like this that means the object referenced by Self will
> ultimately be better handled if you begin using Form. I like to start from
> scratch when  convert a form: make a new blank form. Copy in the most basic
> elements of it and learn to set it up using Form. You will know you're
> doing it right when you stop needing to rely on pointers (especially Self)
> and process variables to manage forms. I stress "rely on" here. Self is
> useful but if you are using ORDA it's the last resort, never the first.
> Process vars have a place but rarely - very rarely - for managing a modern
> 4D form. Learn to use Form instead.
> 
> Once you have the basics working, (opening, closing, moving around,
> populating static or semi static objects) start adding in the other
> functionality. As you do that think about what you trying to accomplish -
> what is goal and purpose of the list, listbox, subform, etc. you are adding
> in. And how do you accomplish that with ORDA. This is important because
> whatever that task is accomplishing it with ORDA will nearly always be a
> completely different workflow from accomplishing it in classic 4D. If you
> simply paste in what you've been doing it's not going to really change
> anything. And if you don't want to really change anything what's the point
> of converting to ORDA?
> 
> By putting this into a brand new form you eventually get to a point where
> you can compare your new approach to the old head to head. And this also
> makes it easier to swap out the new form for the old in your code.
> 
> Hope this helps.
> 
> On Thu, Dec 5, 2019 at 12:00 PM kculotta via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> 
>> Hello,
>> 
>> 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?
>> 
>>  // get Contracts for a group of Clients
>> ARRAY TEXT($array;0)
>> C_COLLECTION($col)
>> 
>> $clients:=ds.Client.query("Name = :1";"@"+Self->+"@")  // get the clients
>> $col:=$clients.toCollection("PriKey")  // make a Collection of Client
>> Primary Keys ("PriKey";"..Value..";"PriKey...)
>> COLLECTION TO ARRAY($col;$array;"PriKey")  // make it an array of Primary
>> Keys
>> ARRAY TO COLLECTION($col;$array)  // back to a Collection of Text
>> ("..Value..";"..Value..&

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 - though you don't need the step of converting to
and from the array:

$clients:=ds.Client.query("Name = :1";"@"+Self->+"@")
$col:=$clients.distinct("PriKey")
EntSel:=ds.Contract.query("to_Client IN :1";$col)

By definition the PriKey should be distinct already but there's no downside
to the command and it will also work for non-distinct values so it's a good
habit to develop.

I would shorten it to a single query line:

$col:=ds.Client.query("Name = :1";"@"+Self->+"@") .distinct("PriKey")
EntSel:=ds.Contract.query("to_Client IN :1";$col)


This doesn't throw an error if the query is empty. And it's two lines of
code to replace 7.

I infer you are retro fitting this ORDA code into an existing form because
of using Self and a process var for EntSel. My experience so far is this is
the less optimal way to implement ORDA. First, classic 4D is probably doing
just fine for this chore so carry on with what you've got. Introducing ORDA
in cases like that usually don't work out great. Your example sort of makes
this point - if you start thinking the way to solve an ORDA problem is to
start converting back and forth between arrays you are probably missing
something new you should be using.

For UI stuff like this that means the object referenced by Self will
ultimately be better handled if you begin using Form. I like to start from
scratch when  convert a form: make a new blank form. Copy in the most basic
elements of it and learn to set it up using Form. You will know you're
doing it right when you stop needing to rely on pointers (especially Self)
and process variables to manage forms. I stress "rely on" here. Self is
useful but if you are using ORDA it's the last resort, never the first.
Process vars have a place but rarely - very rarely - for managing a modern
4D form. Learn to use Form instead.

Once you have the basics working, (opening, closing, moving around,
populating static or semi static objects) start adding in the other
functionality. As you do that think about what you trying to accomplish -
what is goal and purpose of the list, listbox, subform, etc. you are adding
in. And how do you accomplish that with ORDA. This is important because
whatever that task is accomplishing it with ORDA will nearly always be a
completely different workflow from accomplishing it in classic 4D. If you
simply paste in what you've been doing it's not going to really change
anything. And if you don't want to really change anything what's the point
of converting to ORDA?

By putting this into a brand new form you eventually get to a point where
you can compare your new approach to the old head to head. And this also
makes it easier to swap out the new form for the old in your code.

Hope this helps.

On Thu, Dec 5, 2019 at 12:00 PM kculotta via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hello,
>
> 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?
>
>   // get Contracts for a group of Clients
> ARRAY TEXT($array;0)
> C_COLLECTION($col)
>
> $clients:=ds.Client.query("Name = :1";"@"+Self->+"@")  // get the clients
> $col:=$clients.toCollection("PriKey")  // make a Collection of Client
> Primary Keys ("PriKey";"..Value..";"PriKey...)
> COLLECTION TO ARRAY($col;$array;"PriKey")  // make it an array of Primary
> Keys
> ARRAY TO COLLECTION($col;$array)  // back to a Collection of Text
> ("..Value..";"..Value..")
> EntSel:=ds.Contract.query("to_Client IN :1";$col)  // search in the
> Collection
>
> Thanks - Keith CDI
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

What can be said, can be said clearly,
and what you can’t say, you should shut up about

*Wittgenstein and the Computer *
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 produces an entity selection of the related many

Neil














---

Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ORDA RELATE MANY SELECTION

2019-12-05 Thread kculotta via 4D_Tech
Hello,

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?

  // get Contracts for a group of Clients
ARRAY TEXT($array;0)
C_COLLECTION($col)

$clients:=ds.Client.query("Name = :1";"@"+Self->+"@")  // get the clients
$col:=$clients.toCollection("PriKey")  // make a Collection of Client Primary 
Keys ("PriKey";"..Value..";"PriKey...)
COLLECTION TO ARRAY($col;$array;"PriKey")  // make it an array of Primary Keys
ARRAY TO COLLECTION($col;$array)  // back to a Collection of Text 
("..Value..";"..Value..")
EntSel:=ds.Contract.query("to_Client IN :1";$col)  // search in the Collection 

Thanks - Keith CDI
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17.6 How to getting a newly-related record to load in ORDA

2019-11-19 Thread Chris Belanger via 4D_Tech
I read my diagram incorrectly… it is going to a NON-PRIMARY key field. What a 
stupid mis-read. 
I will re-work the structure to use the primary key.
Thanks for the tip. 

— dazed and confused,  Chris :)

> On Nov 19, 2019, at 3:17 PM, Chris Belanger  wrote:
> 
> Man, I must be going crazy… yes, it is to the primary key field in [UnitType]…
> They are both UUIDs.
> 
> — Chris
> 
> 
>> On Nov 19, 2019, at 3:13 PM, Chris Belanger > <mailto:macprogram...@gmail.com>> wrote:
>> 
>> Hi Justin,
>> On checking it again, it is NOT to the primary key in [UnitType].
>> I will try and re-work things to make it the primary key, then.
>> 
>> Thanks for the tip.
>> — Chris
>> 
>> 
>>> On Nov 19, 2019, at 3:33 AM, Justin Carr via 4D_Tech <4d_tech@lists.4d.com 
>>> <mailto:4d_tech@lists.4d.com>> wrote:
>>> 
>>> Hi Chris
>>> 
>>> Is the relationship (UnitType) definitely drawn to the primary key field in 
>>> the one table (the one with the underline in the structure editor)? If not, 
>>> then you cannot do what you want. As I said, 4D will always query the one 
>>> table's primary key for the value you enter into the relation, regardless 
>>> of which field the relation is drawn to.
>>> 
>>> cheers
>>> Justin
>>> 
>>>> On 19 Nov 2019, at 6:50 pm, Justin Carr via 4D_Tech <4d_tech@lists.4d.com 
>>>> <mailto:4d_tech@lists.4d.com>> wrote:
>>>> 
>>>> Hi Chris
>>>> 
>>>> Short answer is that if the many table is related to a field in the one 
>>>> table which is NOT the primary key of the one table, the you should 
>>>> ***ABSOLUTELY NOT USE ORDA*** to set the value of the many table field.
>>>> 
>>>> There is a horrible bug in ORDA where regardless of which field the 
>>>> relation is drawn to in the one table, it will always locate the one 
>>>> record by querying on the primary key field of the one record using the 
>>>> value you have entered into the many field.
>>>> 
>>>> Worse still, when you save the many record, the value you have entered in 
>>>> the related many field will automatically and silently be changed to the 
>>>> related one field value of the now incorrectly loaded one record, thus 
>>>> permanently linking the wrong two records together without any way of 
>>>> knowing that it has happened or of how to undo it!!
>>>> 
>>>> To the best  of my knowledge this bug exists in all versions of 4D since 
>>>> ORDA was introduced, on both Mac and Windows, and both 32- and 64-bit.
>>>> 
>>>> Regards
>>>> Justin
>>>> 
>>>>> On 19 Nov 2019, at 6:16 pm, Chris Belanger via 4D_Tech 
>>>>> <4d_tech@lists.4d.com <mailto:4d_tech@lists.4d.com>> wrote:
>>>>> 
>>>>> I have a challenge,
>>>>> I have a CBOX technique that lets me set the correct related KEY into a 
>>>>> record’s field.
>>>>> It sets the correct value.
>>>>> But that related record is not ‘loaded’ after this correct value is 
>>>>> loaded into that field.
>>>>> 
>>>>> For example:
>>>>> 
>>>>> Two tables (in classic 4D nomenclature)
>>>>> [Units][UnitType]
>>>>> Many-to-one relation is  [Unit]UType
>>>>> 
>>>>> In ORDA, this relation is defined as  Units.UnitType
>>>>> 
>>>>> (   Units.UType  is the foreign key to the [UnitType] master record   )
>>>>> 
>>>>> When the record is first loaded, Units.UnitType is the correct — it has 
>>>>> the related master record from [UnitType]
>>>>> 
>>>>> However, If Units.UType is ever set to another unique key from the 
>>>>> [UnitType] table, the related record is not re-loaded; and Units.UnitType 
>>>>> is null {i.e. no related master record}.
>>>>> 
>>>>> 
>>>>> I do not see any way to trigger the re-load [i.e. CORRECT load] for the 
>>>>> related record  Units.UnitType  {the relation name for Units.UType’s 
>>>>> many-to-one to [UnitType]  }
>>>>> 
>>>>> ——
>>>>> 
>>>>> Is there a way to trigger the related ONE record to re-load in ORDA?  
>>>>> [i.e.  Units.UnitType to be correctly showing the [UnitType] recor

RE: V17.6 How to getting a newly-related record to load in ORDA

2019-11-19 Thread Dennis, Neil via 4D_Tech
> There is a horrible bug in ORDA where regardless of which field the relation 
> is
> drawn to in the one table, it will always locate the one record by querying on
> the primary key field of the one record using the value you have entered into
> the many field.

Justin,

I just ran a couple of tests of this issue in a new structure (4D v17r5, 
Windows 10). I cannot reproduce the results you are seeing

Test 1:

Table_1 -> Table_2 not using primary keys at all
ORDA query Table_1 on other key follow relation to Table_2 (again that 
doesn't go to primarykey)
Success

Test 2:

Table_1 -> Table_2 not using primary keys at all
ORDA query Table_2 on other key follow relation to Table_1  (again that 
doesn't go to primarykey)
Success


Neil





























Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17.6 How to getting a newly-related record to load in ORDA

2019-11-19 Thread Jeremy French via 4D_Tech
What is a “CBOX” technique”?

> On Nov 19, 2019, at 3:16 AM, Chris Belanger via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I have a CBOX technique that lets me

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17.6 How to getting a newly-related record to load in ORDA

2019-11-19 Thread Justin Carr via 4D_Tech
Hi Chris

Is the relationship (UnitType) definitely drawn to the primary key field in the 
one table (the one with the underline in the structure editor)? If not, then 
you cannot do what you want. As I said, 4D will always query the one table's 
primary key for the value you enter into the relation, regardless of which 
field the relation is drawn to.

cheers
Justin

> On 19 Nov 2019, at 6:50 pm, Justin Carr via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi Chris
> 
> Short answer is that if the many table is related to a field in the one table 
> which is NOT the primary key of the one table, the you should ***ABSOLUTELY 
> NOT USE ORDA*** to set the value of the many table field.
> 
> There is a horrible bug in ORDA where regardless of which field the relation 
> is drawn to in the one table, it will always locate the one record by 
> querying on the primary key field of the one record using the value you have 
> entered into the many field.
> 
> Worse still, when you save the many record, the value you have entered in the 
> related many field will automatically and silently be changed to the related 
> one field value of the now incorrectly loaded one record, thus permanently 
> linking the wrong two records together without any way of knowing that it has 
> happened or of how to undo it!!
> 
> To the best  of my knowledge this bug exists in all versions of 4D since ORDA 
> was introduced, on both Mac and Windows, and both 32- and 64-bit.
> 
> Regards
> Justin
> 
>> On 19 Nov 2019, at 6:16 pm, Chris Belanger via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I have a challenge,
>> I have a CBOX technique that lets me set the correct related KEY into a 
>> record’s field.
>> It sets the correct value.
>> But that related record is not ‘loaded’ after this correct value is loaded 
>> into that field.
>> 
>> For example:
>> 
>> Two tables (in classic 4D nomenclature)
>> [Units][UnitType]
>> Many-to-one relation is  [Unit]UType
>> 
>> In ORDA, this relation is defined as  Units.UnitType
>> 
>> (   Units.UType  is the foreign key to the [UnitType] master record   )
>> 
>> When the record is first loaded, Units.UnitType is the correct — it has the 
>> related master record from [UnitType]
>> 
>> However, If Units.UType is ever set to another unique key from the 
>> [UnitType] table, the related record is not re-loaded; and Units.UnitType is 
>> null {i.e. no related master record}.
>> 
>> 
>> I do not see any way to trigger the re-load [i.e. CORRECT load] for the 
>> related record  Units.UnitType  {the relation name for Units.UType’s 
>> many-to-one to [UnitType]  }
>> 
>> ——
>> 
>> Is there a way to trigger the related ONE record to re-load in ORDA?  [i.e.  
>> Units.UnitType to be correctly showing the [UnitType] record]
>> 
>> Confused?
>> 
>> Thanks,
>> Chris
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  
>> https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.htmldata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cf5d2127a009c404dfd8008d76cd89513%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=utlfdnTMt5rhAY%2FU0XmUjszk9IpEBlP2CRC0zYHGIJg%3Dreserved=0
>> Options: 
>> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_techdata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cf5d2127a009c404dfd8008d76cd89513%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=Et1yUOqJN2dh1sbRZkuYuriYl%2BzB76%2BGRGszjAdkYE4%3Dreserved=0
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  
> https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.htmldata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cf5d2127a009c404dfd8008d76cd89513%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=utlfdnTMt5rhAY%2FU0XmUjszk9IpEBlP2CRC0zYHGIJg%3Dreserved=0
> Options: 
> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_techdata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cf5d2127a009c404dfd8008d76cd89513%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=Et1yUOqJN2dh1sbRZkuYuriYl%2BzB76%2BGRGszjAdkYE4%3Dreserved=0
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17.6 How to getting a newly-related record to load in ORDA

2019-11-19 Thread Justin Carr via 4D_Tech
Hi Chris

Short answer is that if the many table is related to a field in the one table 
which is NOT the primary key of the one table, the you should ***ABSOLUTELY NOT 
USE ORDA*** to set the value of the many table field.

There is a horrible bug in ORDA where regardless of which field the relation is 
drawn to in the one table, it will always locate the one record by querying on 
the primary key field of the one record using the value you have entered into 
the many field.

Worse still, when you save the many record, the value you have entered in the 
related many field will automatically and silently be changed to the related 
one field value of the now incorrectly loaded one record, thus permanently 
linking the wrong two records together without any way of knowing that it has 
happened or of how to undo it!!

To the best  of my knowledge this bug exists in all versions of 4D since ORDA 
was introduced, on both Mac and Windows, and both 32- and 64-bit.

Regards
Justin

> On 19 Nov 2019, at 6:16 pm, Chris Belanger via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have a challenge,
> I have a CBOX technique that lets me set the correct related KEY into a 
> record’s field.
> It sets the correct value.
> But that related record is not ‘loaded’ after this correct value is loaded 
> into that field.
> 
> For example:
> 
> Two tables (in classic 4D nomenclature)
> [Units][UnitType]
> Many-to-one relation is  [Unit]UType
> 
> In ORDA, this relation is defined as  Units.UnitType
> 
> (   Units.UType  is the foreign key to the [UnitType] master record   )
> 
> When the record is first loaded, Units.UnitType is the correct — it has the 
> related master record from [UnitType]
> 
> However, If Units.UType is ever set to another unique key from the [UnitType] 
> table, the related record is not re-loaded; and Units.UnitType is null {i.e. 
> no related master record}.
> 
> 
> I do not see any way to trigger the re-load [i.e. CORRECT load] for the 
> related record  Units.UnitType  {the relation name for Units.UType’s 
> many-to-one to [UnitType]  }
> 
> ——
> 
> Is there a way to trigger the related ONE record to re-load in ORDA?  [i.e.  
> Units.UnitType to be correctly showing the [UnitType] record]
> 
> Confused?
> 
> Thanks,
> Chris
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  
> https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.htmldata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cad4c01f6c81f44014ba608d76cc8d450%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=LFYdvJLcBHQeE1DrCsTMNgHcMHrJz9KLWyG7MATewUk%3Dreserved=0
> Options: 
> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_techdata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cad4c01f6c81f44014ba608d76cc8d450%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=Vtu4KP5emmfMa7hTiSXxA5Hk6mt1%2B3x18Lw4Wyz9sGk%3Dreserved=0
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

V17.6 How to getting a newly-related record to load in ORDA

2019-11-19 Thread Chris Belanger via 4D_Tech
I have a challenge,
I have a CBOX technique that lets me set the correct related KEY into a 
record’s field.
It sets the correct value.
But that related record is not ‘loaded’ after this correct value is loaded into 
that field.

For example:

Two tables (in classic 4D nomenclature)
[Units][UnitType]
Many-to-one relation is  [Unit]UType

In ORDA, this relation is defined as  Units.UnitType

(   Units.UType  is the foreign key to the [UnitType] master record   )

When the record is first loaded, Units.UnitType is the correct — it has the 
related master record from [UnitType]

However, If Units.UType is ever set to another unique key from the [UnitType] 
table, the related record is not re-loaded; and Units.UnitType is null {i.e. no 
related master record}.


I do not see any way to trigger the re-load [i.e. CORRECT load] for the related 
record  Units.UnitType  {the relation name for Units.UType’s many-to-one to 
[UnitType]  }

——

Is there a way to trigger the related ONE record to re-load in ORDA?  [i.e.  
Units.UnitType to be correctly showing the [UnitType] record]

Confused?

Thanks,
Chris


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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:
> 
> $oRecs:=ds.Complex.query("Domain_ID = :1";_Domain_ID)
> $coll:=$oRecs.toCollection("ID, Name, Facilities.ID, Facilities.Name")
> $vtReturn:=JSON Stringify($coll)
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 with a template to do what I wanted to.



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 OBJECT($aoFacilities;0)
$oFacilities:=$oRecs.Facilities
For each ($oFac;$oFacilities)
C_OBJECT($oChild)
$oChild:=New object
$oChild.key:=$oFac.ID
$oChild.label:=$oFac.Name
APPEND TO ARRAY($aoFacilities;$oChild)
End for each 
OB SET ARRAY($oComplex;"children";$aoFacilities)
APPEND TO ARRAY($aoComplexs;$oComplex)
End for each 
$vtReturn:=JSON Stringify array($aoComplexs)

Thanks
Justin Will
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 4D_Tech <4d_tech@lists.4d.com>のメール:
>
> $oRecs:=ds.Complex.query("Domain_ID = :1";_Domain_ID)
> $coll:=$oRecs.toCollection("ID, Name, Facilities.ID, Facilities.Name")
> $vtReturn:=JSON Stringify($coll)




**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 JSON. Open or paste this into your text editor.
Change the values for each field to the name you need to map it to. Don't
worry about data types or any of that.
Save this file in RESOURCES. Let's call it 'entityMap.json'

To use it:

$map_obj:=JSON Parse(Document to text())

$export_obj:=New object

For each($property;$entity_obj)

If($map[$property]=Null)  //  not mapped

$export_obj[$property]:=$entity_obj[$property]  //  use the existing name

Else

$export_obj[$map_obj[$property]]:=$entity_obj[$property]  //  use the name
you mapped it to

End if

End for each


//   do something with the export object


In this example I'm assuming the entity is a single 'level'. If you have
object fields you need to map as well you would put the testing part in a
method that takes a map and entity object as params. Then you could test
for object fields and pass the object recursively.

The code will work with any table because you have the actual map values
stored in JSON files.

Looking at the example you provided you are going to need to recognize when
you are exporting related entities. The basic idea is the same. I would
make handle each of the related entities a sub loop of the parent. It will
be more robust than including the relations in your parent entity map.

On Wed, Oct 30, 2019 at 1:45 PM Justin Will via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I need a json object output in a particular format and 4D's new datastore
> and collections do this out of the box in 3 lines of code for me.  It's
> almost magical.
>
> $oRecs:=ds.Complex.query("Domain_ID = :1";_Domain_ID)
> $coll:=$oRecs.toCollection("ID, Name, Facilities.ID, Facilities.Name")
> $vtReturn:=JSON Stringify($coll)
>
> The problem I have is the Javascript libraries I'm using that requires the
> data needs the names of the JSON elements to be named in a particular way.
> Is there a way to tell my collection rename ID to key and Name to label etc?
>
> So 4D is currently outputting this.
>
> [
> {
> "ID": 901,
> "Name": "MP",
> "Facilities": [
> {
> "ID": 1159,
> "Name": "MP:North"
> },
> {
> "ID": 1160,
> "Name": "MP:South"
> }
> ]
> }
> ]
>
>
>
> But what I need is this.
>
> [
> {
> "key": 901,
> "label": "MP",
> "children": [
> {
> "key": 1159,
> "label": "MP:North"
> },
> {
> " key ": 1160,
> "label": "MP:South"
> }
> ]
> }
> ]
>
> I know I could just do a replace in string but this feels like the wrong
> way to go at this.
>
> Thanks
> Justin Will
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

What can be said, can be said clearly,
and what you can’t say, you should shut up about

*Wittgenstein and the Computer *
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ORDA/Collections

2019-10-30 Thread Justin Will via 4D_Tech
I need a json object output in a particular format and 4D's new datastore and 
collections do this out of the box in 3 lines of code for me.  It's almost 
magical.

$oRecs:=ds.Complex.query("Domain_ID = :1";_Domain_ID)
$coll:=$oRecs.toCollection("ID, Name, Facilities.ID, Facilities.Name")
$vtReturn:=JSON Stringify($coll)

The problem I have is the Javascript libraries I'm using that requires the data 
needs the names of the JSON elements to be named in a particular way.  Is there 
a way to tell my collection rename ID to key and Name to label etc?

So 4D is currently outputting this.

[
{
"ID": 901,
"Name": "MP",
"Facilities": [
{
"ID": 1159,
"Name": "MP:North"
},
{
"ID": 1160,
"Name": "MP:South"
}
]
}
]



But what I need is this.

[
{
"key": 901,
"label": "MP",
"children": [
{
"key": 1159,
"label": "MP:North"
},
{
" key ": 1160,
"label": "MP:South"
}
]
}
]

I know I could just do a replace in string but this feels like the wrong way to 
go at this.

Thanks
Justin Will
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: How one does RELATE MANY with ORDA

2019-10-21 Thread Kirk Brooks via 4D_Tech
Hi Peter,

On Mon, Oct 21, 2019 at 12:32 AM Peter Bozek via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am plying with ORDA and LB displaying related records and run into one
> problem: When I delete related record with drop(), entity selection
> accessed through link does not change (probably because documentation says
> that entity stays in memory and is just deleted from disk.)
> I would need to reinitialise linked records by something like RELATED MANY
> commands, but do not see such command in ORDA.
>
and
On Mon, Oct 21, 2019 at 2:55 AM Peter Bozek via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Mon, Oct 21, 2019 at 9:39 AM Christian Sakowski <
> christian.sakow...@heubach-media.de> wrote:
>
> > Normally, just call entity.reload() to refresh an entity and its
> related selections.
> That would work, but  wanted to avoid that as I would loose changes done to
> the edited record, or loose the record when it is new.


A couple of thoughts. It sounds like you have a situation where you have
something like an old-school input form: form is displaying a single record
with a listbox showing some child records. When the user deletes a child
record you want the listbox to refresh to show the updated selection. And
the reason you don't want to use entity.reload() is because this would
compel saving changes to the parent/new record. Have I got that right?

My first thought is why would you allow the user to delete a child record
and NOT save the parent? Just wondering what makes that a problem. (And -
yes I did just ask the equivalent of "why would you want to do that?")

Next, you could wrap the editing process in a transaction. I haven't tried
to see if .reload() respects the state of the transaction but I expect it
to. This isn't my preferred way of handling this sort of thing but it's an
option.

Another thought is to manage the selection of child records manually. It's
trivial to set up and would accommodate the situation of saving/deleting
child records independently of what happens on the parent. There's no rule
that says you _have_ to use the relation in the entity and no penalty for
not using it. You could move the related selection to a collection for
editing/display too.

Yet another thought is to abstract the editing to the equivalent of a
variable and edit the variable. You can use the .toObject() method to
change the contents of a record to an object. This gives you total
flexibility without the overhead of a transaction. Your edit form could
have Form.displayRecord which is this object. For a new record you can use
entity.FromObject(Form.displayRecord). If you use UUIDs for the primary key
you can assign it to the object and then use it as the actual PK. To update
an existing object you will need to loop through the properties. It's an
extra step but gives you very fine control over what gets saved when.

Just some thoughts. ORDA makes it incredibly easy to put data on the screen
in any number of ways.

-- 
Kirk Brooks
San Francisco, CA
===

What can be said, can be said clearly,
and what you can’t say, you should shut up about

*Wittgenstein and the Computer *
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: How one does RELATE MANY with ORDA

2019-10-21 Thread Christian Sakowski via 4D_Tech
Please support my request (which is a quite needful request):

https://forums.4d.com/Post/DE/31495091/1/31495092

Also you can explain your user case in this request. Hopefully it will be in 
v18.
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/41 455 455





> Am 21.10.2019 um 11:55 schrieb Peter Bozek :
> 
> 
> 
> On Mon, Oct 21, 2019 at 9:39 AM Christian Sakowski 
>  wrote:
> Normally, just call entity.reload() to refresh an entity and its related 
> selections.
> --
> 
> 
> That would work, but  wanted to avoid that as I would loose changes done to 
> the edited record, or loose the record when it is new. It seems I will have 
> to do 
> .save()
> .reload()
> 
> which complicates stuff quite a bit.
>  
> --
> 
> Peter Bozek


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: How one does RELATE MANY with ORDA

2019-10-21 Thread Peter Bozek via 4D_Tech
On Mon, Oct 21, 2019 at 9:39 AM Christian Sakowski <
christian.sakow...@heubach-media.de> wrote:

> Normally, just call entity.reload() to refresh an entity and its related
> selections.
> --
>
>
That would work, but  wanted to avoid that as I would loose changes done to
the edited record, or loose the record when it is new. It seems I will have
to do
.save()
.reload()

which complicates stuff quite a bit.

--

Peter Bozek
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: How one does RELATE MANY with ORDA

2019-10-21 Thread Christian Sakowski via 4D_Tech
Normally, just call entity.reload() to refresh an entity and its related 
selections.
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/41 455 455





> Am 21.10.2019 um 09:31 schrieb Peter Bozek via 4D_Tech <4d_tech@lists.4d.com>:
> 
> I am plying with ORDA and LB displaying related records and run into one
> problem: When I delete related record with drop(), entity selection
> accessed through link does not change (probably because documentation says
> that entity stays in memory and is just deleted from disk.)
> I would need to reinitialise linked records by something like RELATED MANY
> commands, but do not see such command in ORDA.
> 
> --
> 
> Peter Bozek
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 field named "some_key_uuid"
> 3) 20-records
> 4) 12 of 20 have value assigned to "some_key_uuid"
> 5) 8 of 20 have no value assigned to "Some_key_uuid". Field value is
> 32-zeroes
>
> Code to locate the 8-records whose "some_key_uuid" contains 32-zeroes:
>
> 
> C_OBJECT($not_assigned1_eso)
> C_OBJECT($not_assigned2_eso)
> C_TEXT($key_t)
>
> $not_assigned1_eso:=ds[Table name(->[test])].query(Field
> name(->[test]some_uuid_key)+" = :1";String(32*"0"))
>
> $key_t:=(32*"0")
> $not_assigned2_eso:=ds.test.query("some_uuid_key = :1";$key_t)
>
> QUERY([test];[test]some_uuid_key=(32*"0"))
> 
>
> Why does ORDA **fail** to locate the entities with 32-zeroes in
> "some_key_uuid", but legacy 4D **does** locate the 8-records?
>
> Here's what I see in the debugger:
>
> https://i.postimg.cc/Pfy88KhZ/p01-orda-vs-legacy-query.png
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

What can be said, can be said clearly,
and what you can’t say, you should shut up about

*Wittgenstein and the Computer *
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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

2019-08-13 Thread Jeremy French via 4D_Tech
Give the following

Table with:
1) primary key "key_uuid"
2) another field named "some_key_uuid"
3) 20-records
4) 12 of 20 have value assigned to "some_key_uuid"
5) 8 of 20 have no value assigned to "Some_key_uuid". Field value is 32-zeroes

Code to locate the 8-records whose "some_key_uuid" contains 32-zeroes:


C_OBJECT($not_assigned1_eso)
C_OBJECT($not_assigned2_eso)
C_TEXT($key_t)

$not_assigned1_eso:=ds[Table name(->[test])].query(Field 
name(->[test]some_uuid_key)+" = :1";String(32*"0"))

$key_t:=(32*"0")
$not_assigned2_eso:=ds.test.query("some_uuid_key = :1";$key_t)

QUERY([test];[test]some_uuid_key=(32*"0"))


Why does ORDA **fail** to locate the entities with 32-zeroes in 
"some_key_uuid", but legacy 4D **does** locate the 8-records?

Here's what I see in the debugger:

https://i.postimg.cc/Pfy88KhZ/p01-orda-vs-legacy-query.png

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 it… then you realise that many printing commands use "legacy" selection / 
current record. 

-- 
Arnaud de Montard 





**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 traditional 4D code.

My approach is to create wrappers that generate ORDA strings from the structure 
references. A lot more work to set up, but hopefully it will pay off in the 
long run. Another advantage of this approach is the work can be abstracted to 
work with other databases, e.g. generate SQL instead of ORDA.

John DeSoi, Ph.D.
 

> On Apr 10, 2019, at 12:01 PM, Christian Sakowski via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> ORDA has many advantages compared to the classic 4D language:

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 return an entitySelections in $0 or receive a 
selection as parameter
- display and edit entitySelections directly in a Listbox (without writing any 
line of code!!!)
- display different entitySelections of the same dataClass on a form

just my two zlotychs
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/52 10 59-23




> Am 10.04.2019 um 18:37 schrieb Chuck Miller via 4D_Tech 
> <4d_tech@lists.4d.com>:
> 
> 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   
> mailto:cjmillerinformed-solutions.com 
> Brookline, MA 02446 USA Registered 4D Developer
>   Providers of 4D and Sybase connectivity
>  http://www.informed-solutions.com  
> 
> This message and any attached documents contain information which may be 
> confidential, subject to privilege or exempt from disclosure under applicable 
> law.  These materials are intended only for the use of the intended 
> recipient. If you are not the intended recipient of this transmission, you 
> are hereby notified that any distribution, disclosure, printing, copying, 
> storage, modification or the taking of any action in reliance upon this 
> transmission is strictly prohibited.  Delivery of this message to any person 
> other than the intended recipient shall not compromise or waive such 
> confidentiality, privilege or exemption from disclosure as to this 
> communication. 
> 
>> On Apr 9, 2019, at 8:46 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> Chuck,
>> There is no reason to use ORDA if you need a regular selection. Just use
>> the classic 4D query commands.
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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   
 mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  

This message and any attached documents contain information which may be 
confidential, subject to privilege or exempt from disclosure under applicable 
law.  These materials are intended only for the use of the intended recipient. 
If you are not the intended recipient of this transmission, you are hereby 
notified that any distribution, disclosure, printing, copying, storage, 
modification or the taking of any action in reliance upon this transmission is 
strictly prohibited.  Delivery of this message to any person other than the 
intended recipient shall not compromise or waive such confidentiality, 
privilege or exemption from disclosure as to this communication. 

> On Apr 9, 2019, at 8:46 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Chuck,
> There is no reason to use ORDA if you need a regular selection. Just use
> the classic 4D query commands.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/52 10 59-23




> Am 10.04.2019 um 16:13 schrieb Herr Alexander Heintz via 4D_Tech 
> <4d_tech@lists.4d.com>:
> 
> 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 all BLOB or OBJECT heavy tables.
> Just created a table called DOC_BLOBS
> And only get the records in demand.
> A world of difference )
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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:
> 
> 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 all BLOB or OBJECT heavy tables.
> Just created a table called DOC_BLOBS
> And only get the records in demand.
> A world of difference )
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 all BLOB or OBJECT heavy tables.
Just created a table called DOC_BLOBS
And only get the records in demand.
A world of difference )
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 to respond. If its doing that on my 
workstation with a SSD locally then it would be horrible over a Remote 10 Mb 
connection.

> On Apr 8, 2019, at 5:23 PM, Christian Sakowski via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> 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 seconds delay/latency, when we 
> have 1.000 records with 4D Write Pro documents in it.
> However, 4D is working on this optimisations. Hopefully.
> 
> A small advice:
> because 4D sends each dot-statement to the server and back:
> 
> ds.Companies.query("…").orderBy(„Name asc")
> 
> you can reduce it to just one statement:
> 
> ds.Companies.query("… order by Name")
> 
> --
> 
> Grüße/Regards,
> [heubach-media] | Christian Sakowski
> christian.sakow...@heubach-media.de
> Tel: +49/(0)40/52 10 59-23
> 
> 
> 
> 
>> Am 08.04.2019 um 23:15 schrieb Keisuke Miyako via 4D_Tech 
>> <4d_tech@lists.4d.com>:
>> 
>> 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
>> 
>>> 2019/04/09 6:10、Eric Naujock via 4D_Tech <4d_tech@lists.4d.com>のメール:
>>> 
>>> Is there a way to limit the number of records returned in a 
>>> ds..query result. I know about the set query limit in the 
>>> system, but I am trying to do this new trick with order and want to be able 
>>> to limit the results to only 1000 records max out of a table with over 
>>> 35,000 rows. Any suggestions would be useful.
>> 
>> 
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> 
> --
> heubach media
> Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
> 22529 Hamburg
> tel: 040 / 52 10 59 - 10 | fax: -99
> mail: i...@heubach-media.de
> home: www.heubach-media.de
> Geschäftsführer|CEO: Matthias Heubach
> 
> Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
> http://www.milo-rental.com
> 
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
> Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
> erhalten haben,
> informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
> Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
> gestattet.
> 
> This e-mail may contain confidential and/or privileged information.
> If you are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail.
> Any unauthorized copying, disclosure or distribution of the
> material in this e-mail is strictly forbidden.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 
when the chapter offers an obvious prefix (as listbox, web services, dom, etc). 
I'm tired to go through the whole Köchel catalog to find an unpredictable 
command name. 

-- 
Arnaud de Montard 





**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 set from the result.
>
> Thanks and regards
>
> Chuck
>
>
>
> --
>
> -
>  Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
>  Informed Solutions, Inc.
>  Brookline, MA 02446 USA Registered 4D Developer
>Providers of 4D, Sybase & SQL Server connectivity
>   http://www.informed-solutions.com
>
> -
> This message and any attached documents contain information which may
> be confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution,
> disclosure, printing, copying, storage, modification or the taking of
> any action in reliance upon this transmission is strictly prohibited.
> Delivery of this message to any person other than the intended
> recipient shall not compromise or waive such confidentiality,
> privilege or exemption from disclosure as to this communication.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

What can be said, can be said clearly,
and what you can’t say, you should shut up about

*Wittgenstein and the Computer *
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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
>
> 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 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
> > <
> https://doc.4d.com/4Dv17/4D/17.1/USE-ENTITY-SELECTION.301-4179710.en.html>
>
> >
> > Regards,
> >
> > Erick
> >
> >
> >
> > --
> > Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
> > **
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 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
>   
> 
> Regards,
> 
> Erick
> 
> 
> 
> --
> Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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
  

Regards,

Erick



--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ORDA and 4D selections

2019-04-09 Thread Charles Miller via 4D_Tech
Hi all,

is there any way to perform a query using ORDA and create a current
selection or set from the result.

Thanks and regards

Chuck



-- 
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Server connectivity
  http://www.informed-solutions.com
-
This message and any attached documents contain information which may
be confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution,
disclosure, printing, copying, storage, modification or the taking of
any action in reliance upon this transmission is strictly prohibited.
Delivery of this message to any person other than the intended
recipient shall not compromise or waive such confidentiality,
privilege or exemption from disclosure as to this communication.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 seconds delay/latency, when we 
have 1.000 records with 4D Write Pro documents in it.
However, 4D is working on this optimisations. Hopefully.

A small advice:
because 4D sends each dot-statement to the server and back:

ds.Companies.query("…").orderBy(„Name asc")

you can reduce it to just one statement:

ds.Companies.query("… order by Name")

--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/52 10 59-23




> Am 08.04.2019 um 23:15 schrieb Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com>:
> 
> 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
> 
>> 2019/04/09 6:10、Eric Naujock via 4D_Tech <4d_tech@lists.4d.com>のメール:
>> 
>> Is there a way to limit the number of records returned in a 
>> ds..query result. I know about the set query limit in the system, 
>> but I am trying to do this new trick with order and want to be able to limit 
>> the results to only 1000 records max out of a table with over 35,000 rows. 
>> Any suggestions would be useful.
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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

> 2019/04/09 6:10、Eric Naujock via 4D_Tech <4d_tech@lists.4d.com>のメール:
>
> Is there a way to limit the number of records returned in a 
> ds..query result. I know about the set query limit in the system, 
> but I am trying to do this new trick with order and want to be able to limit 
> the results to only 1000 records max out of a table with over 35,000 rows. 
> Any suggestions would be useful.





**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ORDA Limiting number of records returned.

2019-04-08 Thread Eric Naujock via 4D_Tech
Is there a way to limit the number of records returned in a 
ds..query result. I know about the set query limit in the system, 
but I am trying to do this new trick with order and want to be able to limit 
the results to only 1000 records max out of a table with over 35,000 rows. Any 
suggestions would be useful.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-09 Thread Arnaud de Montard via 4D_Tech

> Le 9 févr. 2019 à 15:31, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> I always use singular table names and the relationship names are singular or 
> plural based on their type. [...]

Hi, 
using grammatical rules makes reading code closer to human langage. But I 
prefer to have the target table name in the relation name, as Christian said it 
allows generic treatments:
- in french many names have the same singular and plural (mouse -> 
souris/souris, contest -> concours/concours)
- in english it seems easier but there are many plurals that will not allow to 
get the table easily (tooth/teeth, story/stories, fish/fishes) 

-- 
Arnaud de Montard 





**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-09 Thread John DeSoi via 4D_Tech
I always use singular table names and the relationship names are singular or 
plural based on their type. For example, I have a structure that imports 4D 
code and builds a database of each method path and the related methods it 
directly calls:

[Method_Call]ID

[Method_Call]Caller_Method_ID -> [Method]ID
M to 1: Caller
1 to M: Method_Callers

[Method_Call]Callee_Method_ID -> [Method]ID
M to 1: Callee
1 to M: Method_Callees

John DeSoi, Ph.D.



> On Feb 8, 2019, at 12:50 PM, Ed Hammond via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hey all of you ORDA pioneers and converts!
> 
> 
> Have any of you come up with a convention for naming relations for use with 
> ORDA? What have you found that works? or doesn't?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Arnaud de Montard via 4D_Tech

> Le 8 févr. 2019 à 20:18, Christian Sakowski via 4D_Tech 
> <4d_tech@lists.4d.com> a écrit :
> 
>> I went much simpler…
> 
> This is quite the same, but the problem with this approach is, that i cannot 
> parse relations generically.

I do agree, a name that allows to identify the function is great:
  find regex("^FK_";property;1) -> foreign key
  find regex("_p$";property;1) -> many to one relation
And these names are not supposed to change every day…  

-- 
Arnaud de Montard 





**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Arnaud de Montard via 4D_Tech

> Le 8 févr. 2019 à 19:50, Ed Hammond via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Have any of you come up with a convention for naming relations for use with 
> ORDA? What have you found that works? or doesn't?

Hi Ed, 
the relation name is the direction in which we go from one field to another. 
Thus I stick to my table and fields naming to identify in the relation name:
- the destination table
- the direction (many to one ≠ one to many)
The "from" is unnecessary (redundant) because ORDA starts with it:
  ds.dataclass.{property}

For example:
  [company]PK  primary key
  [employee]FK_company ... foreign key
  company_p .. relation to one   {from ds.employee}
  employee_f . relation to many  {from ds.company}

ORDA will be like this:
  ds.employee.company_p … (many to one, to Primary…)
  ds.company.employee_f … (one to many, to Foreign…)

BTW, in french, "p" stands for "père" (father) an "f" for "fils" (sons), it 
suits me. Maybe an english reader would prefer O, M, for one, many, use a 
prefix instead. Some like plural/singular I've seen, like "company" and 
"allEmployees". Too much grammar for me  ;-) 

As two fields in the same table can't have the same name, two properties in the 
same entity must have different names. In case of multiple relation, I still 
follow my foreign keys naming, I add to the names what makes them different. 
For example this table:
  [Human]
   PK
   FK_humanFather
   FK_humanMother
Relations:
  from PK to FK_humanFather: humanFather_f
  from PK to FK_humanMother: humanMother_f
  from FK_humanFather to PK: human_p, father_p, etc.
  from FK_humanMother to PK: human_p, mother_p, etc.

-- 
Arnaud de Montard 



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Christian Sakowski via 4D_Tech
> I went much simpler…

This is quite the same, but the problem with this approach is, that i cannot 
parse relations generically.
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/52 10 59-23




> Am 08.02.2019 um 20:15 schrieb Neil Dennis :
> 
> Given two tables:
> 
> [Invoice]
> [InvoiceItems]
> 
> 
> I went much simpler…
> 
> The many to one from InvoiceItems to Invoice I simply name invoice
> The one to many from Invoice to Invoice Items I simply named invoiceItems
> 
> Then the dot notation comes out to be
> 
> Invoice.invoiceItems
> InvoiceItems.invoice
> 
> 
> 
> 
> Neil
> 
> 
> 
> 
> 
> 


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Neil Dennis via 4D_Tech
Given two tables:

[Invoice]
[InvoiceItems]


I went much simpler…

The many to one from InvoiceItems to Invoice I simply name invoice
The one to many from Invoice to Invoice Items I simply named invoiceItems

Then the dot notation comes out to be

Invoice.invoiceItems
InvoiceItems.invoice




Neil






**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Christian Sakowski via 4D_Tech
Yes, since years i use the following:

Given two tables:

[Invoice]
[InvoiceItems]

The id from the invoice is named as:

[InvoiceItems]_Invoice__

(one leading underscore and double underscore as postfix)

For ORDA i name the relation:

[InvoiceItems]_Invoice__MO

(MO means Many to One) which is an entity and

[Invoice]_InvoiceItems__OM

(One to Many) which is an entitySelection
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/52 10 59-23




> Am 08.02.2019 um 19:50 schrieb Ed Hammond via 4D_Tech <4d_tech@lists.4d.com>:
> 
> Hey all of you ORDA pioneers and converts!
> 
> 
> Have any of you come up with a convention for naming relations for use with 
> ORDA? What have you found that works? or doesn't?
> 
> 
> 
> 
> 
> Edgar Hammond 
> ehamm...@questinformation.com
> 
> Quest Information Systems
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Ed Hammond via 4D_Tech
Hey all of you ORDA pioneers and converts!


Have any of you come up with a convention for naming relations for use with 
ORDA? What have you found that works? or doesn't?





Edgar Hammond 
ehamm...@questinformation.com

Quest Information Systems



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 
> to get the record number.

Gianluca Rigotti
--
Via Rupi di via XXIX Settembre, 27
60125 Ancona (AN)
ITALY
--
T: +39 071 9987145
M: +39 335 1360105, +39 338 4550245
mail: gianluca.rigo...@me.com, gianluca.rigo...@gmail.com
skype: gianluca.rigotti

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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:
> 
> Hi all,
> anyone know if there is a way to get the same value returned by “Record 
> Number” using an ORDA query?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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. 

Gianluca,

You cannot get the “Record Number” by using ORDA. So if you need the 4D record 
number, abandon using ORDA and go back to using the traditional 4D commands 
that do fully support Record Number. 

You may have a strong desire to use ORDA right now because it is new a great 
and all that. But in this particular case, you will not have success if you 
need Record Numbers.

Get your work done migrating your database to stop using Record Numbers. Once 
that is done, you can go back to using ORDA for database access.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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>:
> 
> 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
>> 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>:
>>> 
>>> Hi all,
>>> anyone know if there is a way to get the same value returned by “Record 
>>> Number” using an ORDA query?
>>> 
>>> TIA,
>>> Gianluca
>>> 
>>> 
>>> Gianluca Rigotti
>> 
>> 
>> --
>> heubach media
>> Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
>> 22529 Hamburg
>> tel: 040 / 52 10 59 - 10 | fax: -99
>> mail: i...@heubach-media.de
>> home: www.heubach-media.de
>> Geschäftsführer|CEO: Matthias Heubach
>> =
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@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
> 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>:
>> 
>> Hi all,
>> anyone know if there is a way to get the same value returned by “Record 
>> Number” using an ORDA query?
>> 
>> TIA,
>> Gianluca
>> 
>> 
>> Gianluca Rigotti
> 
> 
> --
> heubach media
> Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
> 22529 Hamburg
> tel: 040 / 52 10 59 - 10 | fax: -99
> mail: i...@heubach-media.de
> home: www.heubach-media.de
> Geschäftsführer|CEO: Matthias Heubach
> =

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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>:
> 
> Hi all,
> anyone know if there is a way to get the same value returned by “Record 
> Number” using an ORDA query?
> 
> TIA,
> Gianluca
> 
> 
> Gianluca Rigotti
> --
> Via Rupi di via XXIX Settembre, 27
> 60125 Ancona (AN)
> ITALY
> --
> T: +39 071 9987145
> M: +39 335 1360105, +39 338 4550245
> mail: gianluca.rigo...@me.com, gianluca.rigo...@gmail.com
> skype: gianluca.rigotti
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ORDA to get "record number" value

2018-11-28 Thread Gianluca Rigotti via 4D_Tech
Hi all,
anyone know if there is a way to get the same value returned by “Record Number” 
using an ORDA query?

TIA,
Gianluca


Gianluca Rigotti
--
Via Rupi di via XXIX Settembre, 27
60125 Ancona (AN)
ITALY
--
T: +39 071 9987145
M: +39 335 1360105, +39 338 4550245
mail: gianluca.rigo...@me.com, gianluca.rigo...@gmail.com
skype: gianluca.rigotti

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Be willing to be a beginner with ORDA

2018-11-24 Thread Kirk Brooks via 4D_Tech
Miyako wrote this in another post recently:

"Form" based design is a total rethink of how to use variables in forms.
Form is an object, and an object is a reference,
which drastically reduces the need for pointers.

historically  a pointer can only point to tables, fields, variables and
arrays.
it could have been extended to support object properties and collection
members but that would send the wrong message.
if you use Form and This, you should never want to use pointers.
you should think of using object notation consistently in code and form.

this is not to say that "generic" code is discouraged in ORDA.
you just think of how to be generic in a different way.

it feels counter intuitive coming from classic 4D code,
but hard-coding object property paths everywhere is the key to writing
generic and reusable code.


I think this outlines where we, experienced 4D developers, find ourselves
with respect to how, why, and if we want to incorporate ORDA and the whole
object-oreiented (or psuedo OO, as some hold) into our work.

I hear folks bemoan how hard it is to make ORDA do what they want within
the context of a 20 year old app. And why it's not faster than native 4D.
And how it's not compatible with SQL. True to all that. And if those
elements are crucial to a project it's not a good candidate for ORDA.

ORDA is good if you have the time and inclination to learn a new language.
Deciding to learn a new language is not a trivial thing. You have to learn
the rules, the syntax, the grammar, the ways of doing things specific to
that language. This is what ORDA presents. It's even more challenging for
experienced devs, I think, because it's right there next to the things we
are so familiar with.

I'm a big fan of ORDA. And I'm still learning. I've put hours into making
something work using Form, collections and references only to come back to
it after figuring out something else to discover say 600 lines of code can
actually be reduced to 200 because I wasn't fully appreciating how to use
references. Learning to use ORDA requires being willing to be a beginner
again.

The payoff for me is programming with ORDA is faster. It's more dynamic.
With respect to a question Miyako was responding to about creating generic
code the approach I'm working with is to create objects with common
properties that are passed to methods expecting those property names. This
doesn't mean you have to re-name your table fields but that you simply
construct an object with references to your fields or form vars to
properties named as expected.

Doing this sort of thing in ORDA is very easy. Doing it in classic 4D
isn't.

For instance, think about an Invoice. Aside for demos an Invoice will
likely involve a number of other tables: Customer, Vendor, items, payments
and and so on. In classic 4D we deal with each of those discretely. With
ORDA I can build a single object for Invoice which includes references to
all of those elements. That can be done on the server and passed to the
client - a big efficiency improvement over a network. A single form is
therefore able to idsplay all aspects of Invoice from that one object. This
is a time sensitive object, of course. But so is loading all that related
data into listboxes and form fields. There's also the benefit of being able
to write a single calculation method to function on the object whether it's
displayed in a form or not.

I encourage you to approach ORDA as a new language. There's a lot familiar
in it but it really is a different way of thinking about how we do things
in 4D.

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@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
>

Neil,

Do not have answer, but, as a workaround, what I did was insert (wrapp)
selection as a property of another  object that holds information about
table (plus few other attributes I found usefull.)

--

Peter Bozek
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 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, at 5:49 PM, Douglas von Roeder via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > 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 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
> >>
>
> --
> Julio Carneiro
> jjfo...@gmail.com
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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, at 5:49 PM, Douglas von Roeder via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> 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 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
>> 

--
Julio Carneiro
jjfo...@gmail.com



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 locked, but
the dataclass name is AWOL. That strikes me as an oversight.

Another issue that needs to be resolved is scoping. I've got a couple of
hundred sets of setters and getters that I've been using with ObjectTools
and I shudder at the idea of all of those property names being added to the
IDE without any sort of scoping mechanism. I'm holding off on that move
until "object-based" becomes "object oriented".

But thanks for letting me know that my posts are getting through!
--
Douglas von Roeder
949-336-2902


On Tue, Oct 23, 2018 at 2:04 PM Chip Scheide <4d_o...@pghrepository.org>
wrote:

> 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 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 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
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> --
> >>
> >> Privacy Disclaimer: This message contains confidential information and
> is
> >> intended only for the named addressee. If you are not the named
> addressee
> >> you should not disseminate, distribute or copy this email. Please delete
> >> this email from your system and notify the sender immediately by
> replying
> >> to this email.  If you are not the intended recipient you are notified
> that
> >> disclosing, copying, distributing or taking any action in reliance on
> the
> >> contents of this information is strictly prohibited.
> >>
> >> The Alternative Investments division of UMB Fund Services provides a
> full
> >> range of services to hedge funds, funds of funds and private equity
> funds.
> >> Any tax advice in this communication is not intended to be used, and
> cannot
> >> be used, by a client or any other person or entity for the purpose of
> (a)
> >> avoiding penalties that may be imposed on any taxpayer or (b) promoting,
> >> marketing, or recommending to another party any matter addressed herein.
> >> **
> >> 4D Internet Users Group (4D iNUG)
> >> Archive:  http://lists.4d.com/archives.html
> >> Options: https://lists.4d.com/mailman/options/4d_tech
> >> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> >> **
> > **
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
>
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 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 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
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> --
>> 
>> Privacy Disclaimer: This message contains confidential information and is
>> intended only for the named addressee. If you are not the named addressee
>> you should not disseminate, distribute or copy this email. Please delete
>> this email from your system and notify the sender immediately by replying
>> to this email.  If you are not the intended recipient you are notified that
>> disclosing, copying, distributing or taking any action in reliance on the
>> contents of this information is strictly prohibited.
>> 
>> The Alternative Investments division of UMB Fund Services provides a full
>> range of services to hedge funds, funds of funds and private equity funds.
>> Any tax advice in this communication is not intended to be used, and cannot
>> be used, by a client or any other person or entity for the purpose of (a)
>> avoiding penalties that may be imposed on any taxpayer or (b) promoting,
>> marketing, or recommending to another party any matter addressed herein.
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 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
>
>
>
>
>
>
>
>
> --
>
> Privacy Disclaimer: This message contains confidential information and is
> intended only for the named addressee. If you are not the named addressee
> you should not disseminate, distribute or copy this email. Please delete
> this email from your system and notify the sender immediately by replying
> to this email.  If you are not the intended recipient you are notified that
> disclosing, copying, distributing or taking any action in reliance on the
> contents of this information is strictly prohibited.
>
> The Alternative Investments division of UMB Fund Services provides a full
> range of services to hedge funds, funds of funds and private equity funds.
> Any tax advice in this communication is not intended to be used, and cannot
> be used, by a client or any other person or entity for the purpose of (a)
> avoiding penalties that may be imposed on any taxpayer or (b) promoting,
> marketing, or recommending to another party any matter addressed herein.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ORDA Entity From

2018-10-23 Thread Dennis, Neil via 4D_Tech
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








--

Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v17 Orda, Transactions, and ListBoxes with related many

2018-09-16 Thread Kirk Brooks via 4D_Tech
Hi Chris,

1) do table forms have any relevance in ORDA anymore?

Sure. Personally I am sticking with them for output forms in user mode, for
example. And I'm still including a bare bones input form as well. I
wouldn't use it for user-facing production forms.

I don’t want to mix ‘classic’ 4D in new projects, and so it seems that I
> should use project forms exclusively. What’s your take on that?
>
I haven't used MODIFY SELECTION in 10+ years. Forms I've made to allow
users to create selections have been dialogs with a listbox.

I am encapsulating my use of ORDA as I get familiar with it. What's that
mean? Within individual methods I don't mix them. As much as possible, and
so far it's been possible, I don't mix them in the context of an overall
task. So if I've got some update action to do which requires finding
records, evaluating and modifying them I'll do all that using ORDA or
classic.

There's a real temptation to use a classic QUERY 'cause I've been doing
that for a long time. But it's worthwhile to learn the ORDA commands for
doing the same thing.



> 2) Recording Editing with related MANY displayed in a ListBox.  ENTITY
> SELECTION-STYLE, not classic
> In a form, say, that displays an invoice, and the invoice detail is
> provided in a ListBox (Collection source), I am concerned about the
> situation where a user may delete lines from the Detail (ListBox) and then
> cancel the record edit (of the Invoice). It seems that editing the records
> (entities) displayed in the ListBox commits the changes as they take place.
>
Not unless you specifically call entity.save
<http://doc.4d.com/4Dv17/4D/17/entitysave.301-3763798.en.html>().

The *entity.save( )* method saves the changes made to the entity in the
table related to its dataClass. You must call this method after creating or
modifying an entity if you want to save the changes made to it.


Does one control this through Transaction control (i.e. so that changes can
> be allowed, but not committed until OK’d)?
> If so, then how does one do that under ORDA, when one is using entity
> selections instead of ‘classic’?
>
The mechanics of this are what you are accustomed to.

ALL RECORDS
$selObj:=Create entity selection
START TRANSACTION
For each ($obj;$selObj) // read: for each $obj is $selObj...
If ($obj._ID%2=0)
$obj._ID:=$obj._ID-2
$obj.save()
End if
End for each
CANCEL TRANSACTION
In this instance each entity has _ID if it's even. Note the explicit save.
Since it's run in a transaction and the transaction is canceled the changes
aren't written to the datastore (records).

In the example you stated let's say you don't call .save() every time
there's a change - how do you do it? You want entity.touched()
<http://doc.4d.com/4Dv17/4D/17/entitytouched.301-3764513.en.html>.

The *entity.touched( )* method tests whether or not an entity attribute has
been modified since the entity was loaded into memory or saved.

If an attribute has been modified or calculated, the method returns true,
else it returns false. You can use this method to determine if you need to
save the entity.

ALL RECORDS
$selObj:=Create entity selection
START TRANSACTION

---  user stuff happens ---


For each ($obj;$selObj)
If ($obj.touched())
$obj.save()
End if
End for each

If($groovy)

VALIDATE TRANSACTION

Else
CANCEL TRANSACTION
End if



> When an INVOICE is to be edited:
>
> ds.Invoice.lock()
>
A pessimistic lock isn't necessary for the transaction to work using ORDA.
It's important in an existing database to avoid conflicts with 'classic'
processes because a pessimistic lock was the only type available before.

A note regarding user deletions of lines from a listbox. To be honest I
thought I understood how to do this but I just tested it and it's not
working. I filed a TAOW case on it asking for explanation so I'm going to
wait until I hear from them before saying anything about it.

Hope the rest helps.

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

v17 Orda, Transactions, and ListBoxes with related many

2018-09-15 Thread Chris Belanger via 4D_Tech
Hi all,

I am really getting into ORDA-style programming with v17 and loving it.
Here are my questions:

1) do table forms have any relevance in ORDA anymore? I don’t want to mix 
‘classic’ 4D in new projects, and so it seems that I should use project forms 
exclusively. What’s your take on that?


2) Recording Editing with related MANY displayed in a ListBox.  ENTITY 
SELECTION-STYLE, not classic
In a form, say, that displays an invoice, and the invoice detail is provided in 
a ListBox (Collection source), I am concerned about the situation where a user 
may delete lines from the Detail (ListBox) and then cancel the record edit (of 
the Invoice). It seems that editing the records (entities) displayed in the 
ListBox commits the changes as they take place.
Does one control this through Transaction control (i.e. so that changes can be 
allowed, but not committed until OK’d)?
If so, then how does one do that under ORDA, when one is using entity 
selections instead of ‘classic’?

Maybe you can give some pseudo-code on how one would do this under ORDA.

Would it be:
When an INVOICE is to be edited:

ds.Invoice.lock()
START TRANSACTION (necessitating that this occurs in its own process so as not 
to interfere with other windows that might be in the process)

after user “ok’s” the record:
If  ds.Invoice.touched()
VALIDATE TRANSACTION[does this save the INVOICE and DETAIL records 
without having to do ds.Invoice.save() etc?]
else
CANCEL TRANSACTION
end if

if they CANCEL it:
CANCEL TRANSACTION

Thanks for your observations,

Chris
Innovative Solutions

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 ;-)
> 


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 speed up their new talent’s learning 
curve in 4D, this is a great opportunity to do so.  In addition, there will 
also be a dedicated amount of time spent discussing ORDA and of course, 4D’s 
newest version v17.
Please contact 4D Sales at 1 800-785-3303.  Have a great day!

Thank you,
Donna Gallis
dgal...@4d.com<mailto:dgal...@4d.com>





**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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 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 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?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

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.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

  1   2   >