複数のレコードタイプが存在するオブジェクトにおいて、カスタムボタンから新規レコード作成画面を呼び出すと、レコードタイプの選択画面が表示されず、意図しないレイアウトが表示されることがあります。
カスタムボタンから新規レコードを作成する際、表示されるレイアウトは以下のように決定されます。
Lightning レコードページが「組織のデフォルト」に割り当てられている場合: その Lightning レコードページの設定が適用されます。
「組織のデフォルト」に割り当てられていない場合: 実行ユーザーのプロファイルで設定されている「デフォルトのレコードタイプ」が適用されます。
現在、Salesforce の標準仕様として、カスタムボタンの defaultFieldValues パラメーターで RecordTypeId を渡す動作はサポートされていません。
RecordTypeId はルーティング動作、ページレイアウトの割り当て、およびページ割り当てに密接に関連しているため、これらを強制的に指定しようとすると予期しない動作やエラーを引き起こす可能性があります。
詳細については、Salesforce ヘルプのカスタムボタンの例: デフォルト項目値を含むレコード作成ページをご参照ください。 ※ヘルプ内でも「RecordTypeId を defaultFieldValues に渡すことはまだサポートされていません」と明記されています。
005299459

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.