Create entity selection
Create entity selection ( dsTable : Table { ; settings : Object } ) : 4D.EntitySelection
| 引数 | 型 | 説明 | |
|---|---|---|---|
| dsTable | テーブル | → | エンティティセレクションの元となるカレントセレクションが属する 4Dデータベースのテーブル |
| settings | Object | → | ビルドオプション: context |
| 戻り値 | 4D.EntitySelection | ← | 指定したテーブルに対応するデータクラスのエンティティセレクション |
履歴
| リリース | 内容 |
|---|---|
| 17 R5 | 変更 |
| 17 | Created |
説明
Create entity selection コマンドは、dsTable で指定したテーブルに対応するデータクラスの追加可能な新規エンティティセレくションを、同テーブルのカレントセレクションに基づいてビルドして返します。
ソートされたカレントセレクションの場合、順列のある エンティティセレクションが作成されます (カレントセレクションの並び順が受け継がれます)。 カレントセレクションがソートされていない場合、順列のないエンティティセレクションが作成されます。カレントセレクションがソートされていない場合、順列のないエンティティセレクションが作成されます。
ds において dsTable が公開されていない場合には、エラーが返されます。 リモートデータストアの場合は、このコマンドは使用できません。リモートデータストアの場合は、このコマンドは使用できません。
任意の settings には、以下のプロパティを持つオブジェクトを渡せます:
| プロパティ | 型 | 説明 |
|---|---|---|
| context | Text | エンティティセレクションに適用されている 最適化コンテキスト のラベル。 |
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 SELECTIONdataClass.newSelection()
プロパティ
| コマンド番号 | 1512 |
| スレッドセーフ | ◯ |