メインコンテンツまでスキップ

フィールド要素を取得

概要

getFieldElement 関数は、指定したフィールドIDに対応するフィールド要素を取得します。
これにより、フィールドの値を直接操作することが可能になります。

構文

atPocket.app.record.getFieldElement(fieldId);

引数

引数名説明
fieldIdstring取得したいフィールドのID

戻り値

説明
HTMLElement指定したフィールドの値を含む要素

使用可能画面

  • レコード詳細画面
  • レコード作成画面
  • レコード編集画面

使用例

const element = atPocket.app.record.getFieldElement('field-1');
if (element) {
element.style.color = 'red';
}