Salesforce の数式で、複数選択リスト項目に値が選択されているかを確認する方法を説明します。ISBLANK 関数を利用することで、入力規則や数式項目で項目が未入力であることを簡単に検知できます。
複数選択リスト項目に値が入力されているかどうかは、ISBLANK 関数を使用して判定できます。
この関数は、項目に値が選択されていない場合に true(真)を返し、1 つ以上の値が選択されている場合に false(偽)を返します。
ISBLANK(複数選択リスト項目のAPI参照名)
【使用例】 入力規則で、複数選択リスト項目「MULTIPICK__c」を必須項目(入力必須)にする場合:
※ MULTIPICK__C: お客様組織の対象の複数選択リスト型項目の API 参照名に置き換えて利用してください。
オブジェクトの「入力規則」設定ページで「新規」ボタンをクリックします。
「数式」の項目に以下の数式を入力します。
ISBLANK(MULTIPICK__c)
エラーメッセージ(例:「この項目は必須です。」)を設定し、保存します。
これにより、ユーザーが「MULTIPICK__c」で何も選択せずにレコードを保存しようとすると、エラーメッセージが表示されます。
通常の選択リスト項目の場合
通常の選択リスト項目(複数選択ではない)が空かどうかを判定するには、TEXT 関数を併用する必要があります。
ISBLANK(TEXT(選択リスト項目のAPI参照名))
テストの推奨
数式を本番環境に適用する前に、必ず Sandbox 環境で意図した通りに動作するかをテストしてください。
002470703

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.