orderBy not working as expected while changing the language.

Ramkumar Thanga
Mega Sage

Hi!!

 

I am displaying a list of values in the catalog form in ascending order with some dynamic filters applied through a script include. 

I use gr.orderBy(fieldName); to sort the values. This works as expected when the instance language is english. When the language gets changed, the order of the listed value in the form gets changed.

 

Any alternate solution to overcome this.

 

Thanks!
Ramkumar

3 REPLIES 3

Mark Manders
Mega Patron

What exactly do you mean that the order gets changed? Isn't it in the correct alphabetical order anymore, or do you expect the order to be the same as it is in English and is it now ordering alphabetically by the other language?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Ramkumar Thanga
Mega Sage

Hi @Mark Manders 

 

Yes, the alphabetical order gets changed while changing the profile language. 

Yes, It is not in the correct alphabetical order for other languages expect English.

Yes, We expect the alphabetical order should not be changed/altered/disturbed for other profile languages like Spanish, German, etc.

 

Thanks!

Ramkumar

Ramkumar Thanga
Mega Sage

Found the cause :

 

As the field type is translated text, the system sort the order based on the provided translated texts. As the translations are not applied, the system sorts the items based on the sys_ids. The proposed solution here is to either change the type of the field to string from translated_text OR to apply the translations.

 

Thanks!
Ramkumar.