Salesforce のロングテキストエリア項目において、改行コードを含む複数行の入力値に対して特定の入力制限(例:7桁の半角数値のみ許可)を設けるための、REGEX 関数を用いた入力規則の設定手順を解説します。
ロングテキストエリア項目で複数行にわたる入力制限を実現するには、入力規則の数式内で改行コード(CRLF「\r\n」、キャリッジリターン「\r」およびラインフィード「\n」)を考慮した正規表現を使用する必要があります。
設定例:複数行にわたって「7桁の半角数値」のみの入力を許可する場合
以下の数式を入力規則として設定します。
| NOT(REGEX(項目名, "([0-9]{7}((\\r\\n|\\n|\\r)[0-9]{7})*)?")) |
数式の解説:
注意点:
000387170

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.