GlideElementDescriptor - スコープ対象、グローバル
GlideElementDescriptor API は、Glide レコードの個々のフィールドに関する情報を提供します。
このクラスにはコンストラクターはありません。GlideElement または GlideRecord getED() メソッドを使用して、GlideElementDescriptor オブジェクトを取得します。
GlideElementDescriptor - getAttachmentEncryptionType()
要素のテーブルの添付ファイルに使用される暗号化タイプを返します。
このメソッドは エッジ暗号化 プラグインで使用します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| 文字列 | 添付ファイルで使用される暗号化タイプ。要素のテーブルの添付ファイルが暗号化されていない場合は null を返します。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isEdge = ed.getAttachmentEncryptionType();
gs.info(isEdge);
出力:
null
GlideElementDescriptor - getEncryptionType()
要素の暗号化タイプを返します。
このメソッドは エッジ暗号化 プラグインで使用します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| 文字列 | 要素の暗号化タイプ。要素が暗号化されていない場合は null を返します。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
sEdge = ed.getEncryptionType();
gs.info(isEdge);
出力:
null
GlideElementDescriptor - getInternalType()
要素の内部データ型を返します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| 文字列 | 要素の内部データ型。 可能な値:
|
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isEdge = ed.getInternalType();
gs.info(isEdge);
integerGlideElementDescriptor - getLabel()
要素のラベルを返します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| 文字列 | 要素のラベル。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isEdge = ed.getLabel();
gs.info(isEdge);
出力:
Priority
GlideElementDescriptor - getLength()
要素の長さを返します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| 番号 | 要素のサイズ。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isEdge = ed.getLength();
gs.info(isEdge);
出力:
40
GlideElementDescriptor - getName()
要素の名前を返します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| 文字列 | 要素の名前。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isEdge = ed.getName();
gs.info(isEdge);
出力:
priority
GlideElementDescriptor:getPlural()
要素の複数形ラベルを返します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| 文字列 | 要素の複数形ラベル。 |
var now_GR = new GlideRecord('incident');
now_GR.query();
var ed = now_GR.getED();
gs.info(ed.getPlural());
出力:
Incidents
GlideElementDescriptor - hasAttachmentsEncrypted()
暗号化された添付ファイルがテーブルに追加されている場合は true を返します。
このメソッドは エッジ暗号化 プラグインで使用します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ブーリアン | 暗号化された添付ファイルがテーブルに追加されている場合は true を返します。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isEdge = ed.hasAttachmentsEncrypted();
gs.info(isEdge);
出力:
false
GlideElementDescriptor:isAutoOrSysID()
要素が自動生成またはシステムフィールドの場合は true を返します。
自動生成されたフィールドとシステムフィールドは暗号化できません。このメソッドは エッジ暗号化 プラグインで使用します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ブーリアン | 要素が自動的に生成されるか、システムフィールドの場合は True。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
isEdge = ed.isAutoOrSysID();
gs.info(isEdge);
出力:
false
GlideElementDescriptor:isChoiceTable()
要素が辞書定義でドロップダウン選択肢として定義されている場合は true を返します。
選択肢フィールドは暗号化できません。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ブーリアン | 要素がドロップダウン選択肢として定義されている場合は true を返します。選択肢テーブルにエントリが定義されていない場合でも true を返します。最後の選択肢タイプである提案は true を返しません。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isChoiceTable = ed.isChoiceTable();
gs.info(isChoiceTable);
出力:
true
GlideElementDescriptor:isEdgeEncrypted()
要素が暗号化されている場合は true を返します。
このメソッドは エッジ暗号化 プラグインで使用します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ブーリアン | 要素が暗号化されている場合は true を返し、それ以外の場合は false を返します。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isEdge = ed.isEdgeEncrypted();
gs.info(isEdge)
出力:
false
GlideElementDescriptor - isEncrypted()
この記述子によって表されるフィールドがフィールド暗号化用に構成されているかどうかを返します。
この方法を使用して、機密データの読み取りまたは書き込み前に暗号化されたフィールドをプログラムで検出したり、フィールドの暗号化ステータスに基づいてアクセスポリシーを適用したりします。
必要なプラグイン:フィールド暗号化スターター (com.glide.field.encryption.starter) このプラグインがないと、 isEncrypted() は false を返します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ブーリアン |
フィールドがフィールド暗号化用に構成されているかどうかを示すフラグ。 有効な値:
|
// Retrieve a sample Incident record
var gr = new GlideRecord('incident');
gr.setLimit(1);
gr.query();
if (gr.next()) {
// Get the GlideElement for the field you want to inspect
var element = gr.getElement('short_description');
// Retrieve the descriptor from the element
var descriptor = element.getED();
// Check whether the field is configured for Field Encryption
if (descriptor.isEncrypted()) {
gs.info('short_description is encrypted. Value: ' + element.getDisplayValue());
} else {
gs.info('short_description is NOT encrypted. Value: ' + gr.getValue('short_description'));
}
}
short_description is NOT encrypted. Value: Unable to connect to networkshort_description is encrypted. Value: Unable to connect to networkGlideElementDescriptor:isMandatory()
要素が必須であり、レコードを保存する前に値を含める必要があるかどうかを決定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ブーリアン | 関連する要素が必須であり、要素を含むレコードを保存する前に値が含まれている必要があるかどうかを示すフラグ。 可能な値:
|
この例は、名前フィールドが必須かどうかを確認する方法を示しています。
var isRecordValid;
var now_GR = new GlideRecord('my_table');
var field = now_GR.getElement('name');
var elementDescriptor = field.getED();
now_GR.query();
while (now_GR.next()) {
if (elementDescriptor.isMandatory() && !now_GR.name) {
isRecordValid = false;
}
}
GlideElementDescriptor - isVirtual()
要素が仮想要素の場合は true を返します。
仮想要素は、フィールドの辞書定義によって設定される計算フィールドです。仮想フィールドは暗号化できません。
| 名前 | タイプ | 説明 |
|---|---|---|
| なし |
| タイプ | 説明 |
|---|---|
| ブーリアン | 要素が仮想要素の場合は true を返します。 |
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();
var isVirtual = ed.isVirtual();
gs.info(isVirtual);
出力:
false