デフォルト項目値をレコード作成ページに渡すカスタムボタンとリンクを作成する際に、数値型項目で値にカンマが含まれている場合、URL パラメータとして正しく解釈されず、カンマ以降の値がコピーされない事象が発生します。
例)
数値型項目の値に「1,234,500」が入力されていた場合、コピー後の値がカンマ以降はコピーされず「1」となる
この問題を解決するには、TEXT 関数と URLENCODE 関数を使用して項目値をエンコードします。
カスタムボタンの URL で数値型項目をデフォルト項目値として渡す際、値にカンマを含む場合は URLENCODE 関数と TEXT 関数を使用します。これにより、カンマが URL の特殊文字として誤って解釈されるのを防ぎ、カンマ以降の値もコピーされます。
■ 取引先 (Account) でのカスタムボタン設定例
以下の例は、ある取引先レコードから新しい取引先レコードを作成するカスタムボタンで、既存の取引先の数値型項目(例:Number_Field__c)の値を、新規取引先の同じ項目にデフォルト値として渡す場合の URL です。
/lightning/o/Account/new?defaultFieldValues= Number_Field__c={!URLENCODE(TEXT(Account.Number_Field__c))}
このように TEXT と URLENCODE で項目を囲むことにより、Number_Field__c の値にカンマ(例: "1,234,500")が含まれていても、値全体が正しく新規レコードの項目にコピーされます。
注意: ボタンと数式のサポートは制限されています。詳細は、「ボタンのサポート範囲」の記事および「数式のサポート範囲」の記事を参照してください。
URLENCODE 関数と TEXT 関数の詳細については、Salesforce ヘルプの記事「URLENCODE」の記事および「TEXT」を参照してください。
デフォルト項目値を含むカスタムボタンの作成については、「カスタムボタンの例: デフォルト項目値を含むレコード作成ページ」の記事を参照してください。
005227057

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.