function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Prakash@SFDCPrakash@SFDC 

Tolabel() not working in Aggregate Query

Hi,

 

Tolable() not retrieving the translated value in the group by Clause. All Variable are initialised properly .

 

aResult = [ select tolabel(Solution__c) from Validated_Solution__c where Publish_Flag__c=TRUE AND Account__c =:AccountIdProfile group by Solution__c Order By Solution__c];

 

if(!aResult.IsEmpty()){

 

for(AggregateResult a:aResult){ 

     String str1 = (String)a.get('Solution__c');

      ValidatedSol.add(str1);

     }

 }

 

with ValidatedSol List i am displaying the results in VF page . While displaying it gives master picklist value but i want to display the translated value .If i use a query w/o Group by It will work . I want to use Group by . Please help me how to achieve this.

 

Many Thanks in advance ,

Prakash.N

 

 

Gobinathan Nagarajan 12Gobinathan Nagarajan 12
aResult = [ select tolabel(Solution__c) alias_solution from Validated_Solution__c where Publish_Flag__c=TRUE AND Account__c =:AccountIdProfilegroup by Solution__c Order By Solution__c];

Use alies it will workout