LoginSignup
0
0

Rich text field

Last updated at Posted at 2023-05-01

まとめページに戻る
まとめN~Z

image.png

リッチテキストへ「{!$~}」のような形でレコード情報を組み込むことはできないと思います。
カスタムリンクを使用すると可能かと思います

NOTE We recommend using the toolbar to format your content. The rich text editor provides only a WYSIWYG interface. You can’t edit HTML tags. When you copy content from a web page or another source and paste it into the editor, unsupported tags are removed. Text enclosed in unsupported tags is preserved as plain text. HTML markup counts against the character limit of the field. For more information, see Rich Text Area Field Limitations.

https://help.salesforce.com/s/articleView?id=sf.fields_using_rich_text_area.htm&type=5

以下のように Matcherを使って画像のタグが含まれているかを確認すれば可能みたいです。

Matcher imgMatcher = Pattern.compile( ‘’ ).matcher(url);

https://debarunsengupta.medium.com/apex-code-to-display-image-from-a-rich-text-area-field-in-salesforce-63272dc4cce

I also faced the same issue, After much brainstorming and research I found the solution for this problem.

Solution:

  1. Create a new field of datatype "Text Area(Long)".
  2. Write a Record-Triggered Flow or Apex Trigger to get Html from Rich Text field and Stamp the same Html to New Field by replacing '<img' with '<img style="max-width: 100%;" '
  3. Use this New field instead of rich text field.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0