4D v19

entitySelection.copy( )

Home

 
4D v19
entitySelection.copy( )

entitySelection.copy( )  


 

Die Methode entitySelection.copy( ) gibt eine Kopie der ursprünglichen Entity-Selection zurück.

Hinweis: Diese Funktion verändert nicht die ursprüngliche Entity-Selection.

Standardmäßig, d.h. ohne den Parameter option, gibt die Funktion eine neue, non-shareable Entity-Selection zurück (auch wenn sie auf eine shareable Entity-Selection angewendet wird). Übergeben Sie die Konstante ck shared im Parameter option, wenn Sie eine shareable Entity-Selection erstellen wollen.

Hinweis: Weitere Informationen dazu finden Sie im Abschnitt Shareable vs alterable Entity-Selections

Eine neue, leere Entity-Selection der Produkte erstellen, wenn das Formular geladen wird:

 Case of
    :(Form event code=On Load)
       Form.products:=ds.Products.newSelection()
 End case

Dann wird diese Entity-Selection mit Produkten aktualisiert und die Produkte sollen zwischen mehreren Prozessen geteilt werden. Sie kopieren die Entity-Selection Form.products mit der Option shareable:

 ...
  // The Form.products entity selection is updated
 Form.products.add(Form.selectedProduct)
 
 Use(Storage)
    If(Storage.products=Null)
       Storage.products:=New shared object()
    End if
 
    Use(Storage.products)
       Storage.products:=Form.products.copy(ck shared)
    End use
 End use



Siehe auch 

OB Copy

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: ORDA - EntitySelection

 
SEITENINHALT 
 
GESCHICHTE 

 
ARTIKELVERWENDUNG

4D Programmiersprache ( 4D v19)
4D Programmiersprache ( 4D v19.1)