4D v19

entitySelection.copy( )

Home

 
4D v19
entitySelection.copy( )

entitySelection.copy( )  


 

The entitySelection.copy( ) function returns a copy of the original entity selection.

Note: This function does not modify the original entity selection.

By default, if the option parameter is omitted, the function returns a new, non-shareable entity selection (even if the function is applied to a shareable entity selection). Pass the ck shared constant in the option parameter if you want to create a shareable entity selection.

Note: For information on the shareable property of entity selections, please refer to the Shareable vs Alterable entity selections paragraph. 

Example  

You create a new, empty entity selection of products when the form is loaded:

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

Then this entity selection is updated with products and you want to share the products between several processes. You copy the Form.products entity selection as a shareable one:

 ...
  // 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



See also 

OB Copy

 
PROPERTIES 

Product: 4D
Theme: ORDA - EntitySelection

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)