Loading

Sales: Field values containing commas are not copied when setting default field values via custom buttons.

Fecha de publicación: Nov 12, 2025
Descripción

When creating custom buttons or links to pass default field values to a record create page, an issue occurs where currency or number fields containing commas are not parsed correctly as URL parameters. This results in values being truncated after the first comma.

 

Example:

If a number field contains "1,234,500", only "1" is copied, and the values following the comma are lost.

 

To resolve this issue, you must encode the field value using the TEXT and URLENCODE functions.

Solución

When passing a number field as a default field value in a custom button URL, use the URLENCODE and TEXT functions if the value contains commas. This prevents the comma from being misinterpreted as a URL special character (delimiter) and ensures that the entire value, including everything after the comma, is copied correctly.

 

■ Example: Custom Button Setup on the Account Object
The following example shows a URL for a custom button that creates a new Account record from an existing one. It passes the value of a number field (e.g., Number_Field__c) from the existing Account to the same field on the new record as a default value.

 

/lightning/o/Account/new?defaultFieldValues=Number_Field__c={!URLENCODE(TEXT(Account.Number_Field__c))}

 

By wrapping the field with TEXT and URLENCODE as shown above, even if the value of Number_Field__c contains commas (e.g., "1,234,500"), the entire value will be correctly populated in the new record’s field.

 

Note: Support for buttons and formulas is limited. For more details, please refer to the articles "Scope of Support for Buttons" and "Scope of support for formulas"

Recursos adicionales

For more details on the URLENCODE and TEXT functions, please refer to the Salesforce Help articles "URLENCODE" and "TEXT."

 

For information on creating custom buttons that include default field values, please refer to the article "Custom Button Example: Record Create Page with Default Field Values"

Número del artículo de conocimiento

005227057

 
Cargando
Salesforce Help | Article