0
0

選択リストのまとめ

Last updated at Posted at 2022-06-19

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

カスタム選択リスト項目をグローバル選択リスト値に昇格させましたが、Bオブジェクトの選択リスト項目には、そのグローバル選択リスト値を反映させることはできないのでしょうか。

残念ながら既存の項目を既存のグローバル選択リスト値セットに変更することはできないようです。以下の投稿の中ではメタデータを変更してもエラーで変更できなかったという報告もあります。

  • You can only promote restricted picklists. If you want to promote an unrestricted picklist, first convert it to a restricted picklist.
  • You cannot promote a field to an existing global value set. But check out this Salesforce Lab App for some help.

https://salesforce.stackexchange.com/questions/123342/converting-an-existing-picklist-to-use-global-picklist

新しく追加した選択リスト値が表示されない

Is the record type set for the Account object?

You must associate a record type with the picklist values ​​you added.

https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4XnKSAV

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

Salesforce の取引先オブジェクトに選択リスト項目であるカスタム項目を作成しました。何らかの理由で、レポートをフィルタリングしている場合、そのフィールドにはすべての値が表示されますが、取引先オブジェクトのページ レイアウトでは、そのフィールドには選択リスト フィールドの下にあるすべての値が表示されません。

I was facing the same issue, I got it fixed by checking the "Field Dependencies" the pick-list field was a "Dependent Field" , then just edit under action and add the new pick list value on the available columns.
Setup>Object Manager>Object>Field Relationships>Field Dependencies

Newest Picklist value not showing in drop-down
https://developer.salesforce.com/forums/?id=906F0000000BCmeIAG

私は同じ問題に直面していました。「フィールドの依存関係」をチェックして、選択リストフィールドが「依存フィールド」であることを確認して、アクションの下で編集し、使用可能な列に新しい選択リスト値を追加するだけで修正されました。
[セットアップ] > [オブジェクト マネージャー] > [オブジェクト] > [フィールドの関係] > [フィールドの依存関係]

複数選択リストでワイルドカードが使えない

最大値の回避

選択リストに含めることができる最大文字数は、選択リストのタイプによって異なります。各選択リストの値には、表示されないが文字数制限に含まれる改行と戻り文字が含まれます。
リストビューフィルターの選択リスト値を選択する場合、選択した選択リスト値の合計サイズは240文字未満である必要があります。
その他の制限は、標準およびカスタムの選択リストに適用されます。

選択リストの制限

静的リストで回避できるみたい

元の質問:「情報質問ピックリストの追加」の最大文字数制限

this worked for us by using a static, and not global, picklist.

複数選択リストの順序が正しくありません

データベースに関する限り、値は作成された順序で単純に入力されました。あなたが行ったことは、GUI に表示される順序を変更するように SF に指示することです。そのため、クエリの結果は、GUI に表示するように指示した順序ではなく、作成された順序で返されます。クエリは、GUI ではなく、メモリの場所をクエリするだけです。
Order of values in a multi-select picklist is not consistent

Unfortnately Aayushi, you will have to list the 25 values. You will also need to decide when the picklist has mutliple values belonging to separate categories, if you want the formula to list all the possible categories (mayeb separated by a comma), or just the first one

残念ながら、アーユシさん、25 個の値をリストする必要があります。また、選択リストに個別のカテゴリに属する​​複数の値が含まれている場合、式ですべての可能なカテゴリ (カンマで区切られた可能性あり) をリストするか、最初のカテゴリのみをリストするかを決定する必要もあります。

メタデータ

エラー

Please check this article.

Error 'bad value for restricted picklist field' appears when a record is created
https://help.salesforce.com/s/articleView?id=000384095&type=1

After reviewing the article, I understand that I don't have any Global Value Sets in my unlocked package. The error is related to the Contact.GenderIdentity standard custom field which is not available in the Sandbox where I'm attempting to install the unlocked package version.

記事を確認した結果、ロック解除されたパッケージにグローバル値セットが含まれていないことがわかりました。このエラーは、ロック解除されたパッケージ バージョンをインストールしようとしているサンドボックスでは使用できない Contact.GenderIdentity 標準カスタム フィールドに関連しています。

It seems like the addition caused another problem, but it seems to work.

Dependent Picklist using Global Value Set
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8KesSAF

以下の挙動になります。

無効化した値がレコードの作成/更新時に選択可能なオプションとして表示されなくなります。ただし、削除前にこの値が含まれていた既存のレコードには引き続きこの値が表示されます。

https://help.salesforce.com/s/articleView?id=000384482&type=1

デフォルト値の設定

英語ですがCase 関数を使って数式でデフォルト値を設定する方法が解説されていますが、

選択リストのAPI名で指定しているので、 インデックス番号(1) のような指定はできないと思います。

https://salesforce.stackexchange.com/questions/389886/how-to-set-a-default-value-on-a-picklist-from-the-running-users-user-record

https://salesforcefaqs.com/salesforce-picklist-default-value-formula/

フローで値を追加する

フローを使って値を追加できるみたいですが、フローでは有効化ができないみたいです。
この部分はApexのコードが必要です。

Metadata APIの操作が必要になると思います。

以前に指定ログインを使ってMetadata APIを操作しようとしたことがありますが、その時は302エラーになってしまいました。結局指定ログインを使わずにゴリゴリコーディングしたような記憶があります。

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000E03gySAB

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000EA1PZ

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