Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Tweeted twitter.com/StackSalesforce/status/761429921306664960
added 12 characters in body
Source Link
Sergej Utko
  • 22.1k
  • 11
  • 60
  • 88

I am using the toLabel function in an aggregate query, but it doesn't return the translation of the picklist value.

I have changed the language of the user to Dutch and executed the following query:

SELECT toLabel(Equipment__r.technical_Platform__c)  
FROM Maintenance_Schedule__c  
GROUP BY Equipment__r.technical_Platform__c 

The query returns the English value: Other Elevator likes

When I remove the GROUP BY from the query, it returns the translated value:

SELECT toLabel(Equipment__r.technical_Platform__c)  
FROM Maintenance_Schedule__c

Result with the Dutch value: Overige

I am not able to add the toLabel function in the GROUP BY, since only date aggregate functions are allowed as grouping expressions. I checked the documentation of the toLabel function, but it doesn't mention anything about grouping expressions. Documentation

I also found a topic about the same issue on the developer forums of Salesforce, but it didn't get any replies and it is from 2012. Topic

I could execute a 2nd query without the GROUP BY to get the translated values and map it to results of the results of the query with the GROUP BY, but I am wondering if there is a better solution?

I am using the toLabel function in an aggregate query, but it doesn't return the translation of the picklist value.

I have changed the language of the user to Dutch and executed the following query:

SELECT toLabel(Equipment__r.technical_Platform__c) FROM Maintenance_Schedule__c GROUP BY Equipment__r.technical_Platform__c 

The query returns the English value: Other Elevator likes

When I remove the GROUP BY from the query, it returns the translated value:

SELECT toLabel(Equipment__r.technical_Platform__c) FROM Maintenance_Schedule__c

Result with the Dutch value: Overige

I am not able to add the toLabel function in the GROUP BY, since only date aggregate functions are allowed as grouping expressions. I checked the documentation of the toLabel function, but it doesn't mention anything about grouping expressions. Documentation

I also found a topic about the same issue on the developer forums of Salesforce, but it didn't get any replies and it is from 2012. Topic

I could execute a 2nd query without the GROUP BY to get the translated values and map it to results of the results of the query with the GROUP BY, but I am wondering if there is a better solution?

I am using the toLabel function in an aggregate query, but it doesn't return the translation of the picklist value.

I have changed the language of the user to Dutch and executed the following query:

SELECT toLabel(Equipment__r.technical_Platform__c)  
FROM Maintenance_Schedule__c  
GROUP BY Equipment__r.technical_Platform__c 

The query returns the English value: Other Elevator likes

When I remove the GROUP BY from the query, it returns the translated value:

SELECT toLabel(Equipment__r.technical_Platform__c)  
FROM Maintenance_Schedule__c

Result with the Dutch value: Overige

I am not able to add the toLabel function in the GROUP BY, since only date aggregate functions are allowed as grouping expressions. I checked the documentation of the toLabel function, but it doesn't mention anything about grouping expressions. Documentation

I also found a topic about the same issue on the developer forums of Salesforce, but it didn't get any replies and it is from 2012. Topic

I could execute a 2nd query without the GROUP BY to get the translated values and map it to results of the results of the query with the GROUP BY, but I am wondering if there is a better solution?

Source Link
svenf
  • 504
  • 4
  • 19

toLabel() in aggregate query

I am using the toLabel function in an aggregate query, but it doesn't return the translation of the picklist value.

I have changed the language of the user to Dutch and executed the following query:

SELECT toLabel(Equipment__r.technical_Platform__c) FROM Maintenance_Schedule__c GROUP BY Equipment__r.technical_Platform__c 

The query returns the English value: Other Elevator likes

When I remove the GROUP BY from the query, it returns the translated value:

SELECT toLabel(Equipment__r.technical_Platform__c) FROM Maintenance_Schedule__c

Result with the Dutch value: Overige

I am not able to add the toLabel function in the GROUP BY, since only date aggregate functions are allowed as grouping expressions. I checked the documentation of the toLabel function, but it doesn't mention anything about grouping expressions. Documentation

I also found a topic about the same issue on the developer forums of Salesforce, but it didn't get any replies and it is from 2012. Topic

I could execute a 2nd query without the GROUP BY to get the translated values and map it to results of the results of the query with the GROUP BY, but I am wondering if there is a better solution?