Legacy Knowledge Base
公開されました Jul. 2, 2025

ddmforminstancereportエンティティにおけるフォームのfieldReference名。

Written By

Kanchan Bisht

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • フォームの FieldReference フィールドの変更値は、ユーザーがフォームの UI を変更すると、データベース ddmforminstancereport のエンティティでも更新される必要があります。
    再現するための手順
    1) フォームを作成する
    2) 'Text' フィールドを追加する
    3) このフィールドの 'Advanced' タブに移動する
    4) 'FieldReference' フィールドのテキストを変更する
    5) フォームを公開する
    観察した動作: データベース(ddmforminstancereport)では、デフォルトの文字列が残っていますが、UI上ではFieldReferenceのフィールドで変更した値を確認することができます。

Environment

  • Liferay DXP 7.4 アップデート 1

解決策

  • 観測された動作は、Liferay DXPの意図した動作です。
  • データベースはDXPのニーズを満たすように設計されており、ここで修正することはできません。
    そこでフィールドリファレンスを追加してしまうと、フィールドリファレンスが変わるたびに、このテーブルの行を更新して、データが陳腐化しないようにしなければなりません。
    • フィールド名は不変であり、ユーザーが一定の識別子を必要とするこのようなユースケースのために作られたものです。 この表は、Forms内のグラフをプロットするための補助表でもあることに留意してください。

追加情報

  • もしユーザーがその中のデータを活用したいのであれば、次のような回避策があります。まず、フィールドを参照で検索してその名前を取得し、それを使ってこのテーブルの中のデータを検索することで、うまくいくはずです。
    • ユーザーが自分の DDMForm にアクセスできる場合、 getDDMFormFieldsReferencesMap メソッドを使用しようとすることができます。 このメソッドは、 FieldReference をキーとするマップを返す。 そして、以下のようにフィールドIDにアクセスすることが可能です:
      Map<String, DDMFormField> ddmFormFields = ddmForm.getDDMFormFieldsReferencesMap(true);
      DDMFormField ddmFormField = ddmFormFields.get("FirstName");
      String fieldID = ddmFormField.getName();

      これにより、ユーザーは投稿されたフォームからデータを取得するために、 fieldID を代わりに使用することができます。

    • したがって、要約すると、ユーザーはテーブルからデータを取得できるようなgroovyスクリプトを作成することができます。

  • 私たちは、あらゆるスクリプト、カスタマイズ、および開発に関するさらなる支援のために、 "Global Service Team" というチャンネルを用意しています。
Did this article resolve your issue ?

Legacy Knowledge Base