メインコンテンツまでスキップ
バージョン: 21

Create entity selection

Create entity selection ( dsTable : Table { ; settings : Object } ) : 4D.EntitySelection

引数型説明
dsTableテーブル→エンティティセレクションの元となるカレントセレクションが属する 4Dデータベースのテーブル
settingsObject→ビルドオプション: context
戻り値4D.EntitySelection←指定したテーブルに対応するデータクラスのエンティティセレクション
履歴
リリース内容
17 R5変更
17Created

説明​

Create entity selection コマンドは、dsTable で指定したテーブルに対応するデータクラスの追加可能な新規エンティティセレくションを、同テーブルのカレントセレクションに基づいてビルドして返します。

ソートされたカレントセレクションの場合、順列のある エンティティセレクションが作成されます (カレントセレクションの並び順が受け継がれます)。 カレントセレクションがソートされていない場合、順列のないエンティティセレクションが作成されます。カレントセレクションがソートされていない場合、順列のないエンティティセレクションが作成されます。

ds において dsTable が公開されていない場合には、エラーが返されます。 リモートデータストアの場合は、このコマンドは使用できません。リモートデータストアの場合は、このコマンドは使用できません。

任意の settings には、以下のプロパティを持つオブジェクトを渡せます:

プロパティ型説明
contextTextエンティティセレクションに適用されている 最適化コンテキスト のラベル。
info

For performance reasons, in 4D single-user and 4D Server, the returned entity selection is directly connected to the current selection of dsTable (it is not a copy). Until the current selection is replaced, changes made to one are reflected in the other. For example, REDUCE SELECTION shortens the entity selection, and .add() on the entity selection adds the entity to the current selection. To get an independent entity selection, call .copy() on the result:

$es:=Create entity selection([Employee]).copy()

例題​

var $employees : cs.EmployeeSelection
ALL RECORDS([Employee])
$employees:=Create entity selection([Employee])
// $employees エンティティセレクションには、
// Employee データクラスの全エンティティへの参照が格納されています

参照​

USE ENTITY SELECTION
dataClass.newSelection()

プロパティ​

コマンド番号1512
スレッドセーフ◯