0

We are facing a weird issue in the results that are sorted by name for products.

Scenario 1: User 1 opens the VF page which shows a list of products-sorted by name. They appear in the order with numerical names in the start- '24/7 A','24/7B','24/7C','A product','B Product','C Product'...

Scenario 2: User 2 opens the VF page which shows a list of products-sorted by name. They appear in the order with numerical names in the last- 'A product','B Product','C Product','24/7 A','24/7B','24/7C'...

Issue: First I would like to understand the cause of this difference in the placing of the numerical names in the result. Is it a user based setting? We have a functionality which brings in only 1000 products. Usually the total products are less than 1000. But for the standard price book, the product list exceeds 1000 and few products are missing. In Scenario 2, the numerical named products are missing, which actually brought light to this issue, as our user 2 wanted to add the '24/7 A' product, but couldn't find it due to the limit of 1000. This is the code:

    [SELECT Name, ProductCode, Description, CurrencyIsoCode FROM Product2 WHERE Id IN (SELECT Product2Id FROM PricebookEntry WHERE IsActive = true AND Pricebook2Id =:priceBookId AND CurrencyIsoCode =:opp.CurrencyIsoCode) AND (Product_Category__c = 'First Maintenance' OR Product_group_type__c ='Value Added Service') ORDER BY Name LIMIT 1000]
3
  • Do you have asian users? (or users with an asian locale) Jun 23, 2020 at 9:06
  • Yes @SergioAlcocer, user 1 is Asian while user 2 is French Jun 23, 2020 at 10:14
  • then I think my answer might explain the behaviour you experience ;) Jun 23, 2020 at 10:27

1 Answer 1

0

According to the doc:

Sort order is determined by current user locale. For English locales, Salesforce uses a sorting mechanism based on the UTF-8 values of the character data. For Asian locales, Salesforce uses a linguistic sorting mechanism based on the ISO 14651 and Unicode 3.2 standards.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .