Loading
Salesforce Help 사이트 “Help Agent powered by Fin” 도입 안내더 많이 읽기
Tableau 고객 대상: Tableau를 이용하는 고객이 Help 사이트에서 사례(케이스)를 등록할 수 없는 경우의 대체 수단더 많이 읽기
Slack 관련 문의처가 Salesforce Help로 통합 및 변경됩니다.더 많이 읽기

Salesforce List View Does Not Sort Text Fields in Alphabetical or Numerical Order

게시 일자: Oct 13, 2022
상세 설명

In Salesforce, list views may not sort in the order you expect. This most often occurs when sorting using text fields that contain numerical values, or when sorting picklist fields that include inactive values. This behavior also applies when using the "Set by multiple columns" sort feature.
Example:

  • 2080 Century Park East, Suite # 1804
  • 2080 Century Park East, Suite # 203

Issue: Suite 1804 should sort after Suite 203, but instead appears before it in the list view. Additionally, encrypted fields cannot be sorted in a list view.

솔루션

List views in Salesforce sort text fields character-by-character rather than numerically, which can cause unexpected ordering. For example: 2080 Century Park East, Suite # 1804 comes before 2080 Century Park East, Suite # 203 because it sees that the "1" in "1804" comes before the "2" in "203". It does not evaluate "1804" as a whole number. To get correct numerical sorting, use Number field types instead of Text fields. For picklist fields, inactive values must be alphabetized alongside active values to sort correctly.


If the sorting field is a text field containing numbers:
The recommended workaround is to store numerical values in fields of type Number instead of Text. When a Number field is sorted, Salesforce evaluates the value as a whole number. In this case, "203" correctly appears before "1804".

 

If the sorting field is a picklist:
Inactive picklist values may be causing unexpected sort behavior. To fix this:

  1. In Lightning Experience: Click the Gear Icon | Setup | Object Manager | Object | Fields & Relationships. In Salesforce Classic: Your Name | Setup | Customize | Object | Fields.
  2. Click the name of the desired picklist field.
  3. Click the Reorder button.
  4. Select the Display values alphabetically, not in the order entered checkbox.

The sort will now work with both inactive and active values in your list view.

Additional Resources

 

Knowledge 기사 번호

000385188

 
로드 중
Salesforce Help | Article