Hi,

i discovered this bug last year. It was registered under:

UID13 - ACI0100101: USE ENTITY SELECTION does not return the correct record in 
selection in C/S-mode if the entity has been added with the method 
'$selection.add'

Answer was:

Problem normally fixed with the Version : 18 build : 243746
------------------------------------------------------------------------

Bug Number: ACI0100101

This bug is reproducible with the following 4 versions:

- DEV (243285)
- 18 (243340)
- 17 R6 (243126)
- 17.3 (243342)

ONLY IN CLIENT/SERVER MODE

When creating an entitySelection with newSelection(), USE ENTITY SELECTION does 
not work in C/S-mode. Example:

- Launch the database attached in Client/server mode
-Execute the methode 'P1'

C_OBJECT($selection)
$selection:=ds.T1.newSelection()
$selection.add(ds.T1.get(1))
USE ENTITY SELECTION($selection)

ALERT(String(Records in selection([T1])))

ACTUAL RESULT: 
--> Records in selection([T1]) return 0

EXPECTED RESULT: entitySelection should not change
--> Records in selection([T1]) should return 1

--

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





> Am 03.04.2020 um 03:14 schrieb Matt Bollwitt via 4D_Tech 
> <4d_tech@lists.4d.com>:
> 
> Hello –
> 
> I’m running into a condition where USE ENTITY SELECTION is not working with 
> an entity selection that is built with entitySeletion.add() command. I’m 
> wondering if I’m using it correctly. I’m running 4Dv17r6. Here is a 
> simplified version of what I’m trying to do:
> 
> C_Object($sel;$sel_d;$sel_find)
> C_Date(vFindDate)
> vFindDate:=Date(ALERT("Enter date:"))
> $sel_d:=ds.People.query("Receive_Mail = :1";True)           //all records to 
> be compared
> $sel_find:=ds.People.newSelection()  //empty entity
> For each ($item;$sel_d)
>                $sel:=ds.Entries.query("People_ID = :1 order by Entry_Date 
> desc";$item.LinkID)
>                If ($sel.length#0)              //anything found?
>                                If ($sel[0].Entry_Date<=vFindDate)           
> //compare date of first entry
>                                                $sel_find.add($item)
>                                End if
>                End if
> End for each
> USE ENTITY SELECTION($sel_find)
> 
> I can trace this and see that the $sel_find is a selection of entities from 
> People. However, when I try to pull that entity selection back into a normal 
> selection it does nothing. The selection of records in the People table is 
> the same selection as it was before the method was ran.
> 
> Can you use the entitySelection.add command  to build the entity and then 
> later use the USE ENTITY SELECTION command? I had this working using classic 
> 4D commands and thought I’d convert it to ORDA. I’m wondering if I’m 
> understanding the .add command correctly or if something else needs to be 
> done with that object before I call the USE ENTITY SELECTION.
> 
> Thanks!
> 
> Matt Bollwitt
> 
> **********************************************************************
> 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
**********************************************************************

Reply via email to