Skip to main content
added 109 characters in body
Source Link
raygo
  • 305
  • 1
  • 5
  • 13

I'm doing this query:

 SELECT
      ID, Name, Email_Domain__c
    FROM
      Contact
        GROUP BY Email_Domain__c

And I'm getting this error

MALFORMED_QUERY: GROUP BY Email_Domain__c ^ ERROR at Row:5:Column:12 field 'Email_Domain__c' can not be grouped in a query call

Is there a way form to GROUP BY a custom field?

Pretty much what I want to do is in one call, get the domains for all the emails from the Contact object.

UPDATE

When I check this field in workbench, it has these 2 properties

calculatedFormula: RIGHT(Email,((LEN(Email)-(FIND("@",Email)))))

groupable: false

I'm doing this query:

 SELECT
      ID, Name, Email_Domain__c
    FROM
      Contact
        GROUP BY Email_Domain__c

And I'm getting this error

MALFORMED_QUERY: GROUP BY Email_Domain__c ^ ERROR at Row:5:Column:12 field 'Email_Domain__c' can not be grouped in a query call

Is there a way form to GROUP BY a custom field?

UPDATE

When I check this field in workbench, it has these 2 properties

calculatedFormula: RIGHT(Email,((LEN(Email)-(FIND("@",Email)))))

groupable: false

I'm doing this query:

 SELECT
      ID, Name, Email_Domain__c
    FROM
      Contact
        GROUP BY Email_Domain__c

And I'm getting this error

MALFORMED_QUERY: GROUP BY Email_Domain__c ^ ERROR at Row:5:Column:12 field 'Email_Domain__c' can not be grouped in a query call

Is there a way form to GROUP BY a custom field?

Pretty much what I want to do is in one call, get the domains for all the emails from the Contact object.

UPDATE

When I check this field in workbench, it has these 2 properties

calculatedFormula: RIGHT(Email,((LEN(Email)-(FIND("@",Email)))))

groupable: false
Source Link
raygo
  • 305
  • 1
  • 5
  • 13

GROUP BY custom field

I'm doing this query:

 SELECT
      ID, Name, Email_Domain__c
    FROM
      Contact
        GROUP BY Email_Domain__c

And I'm getting this error

MALFORMED_QUERY: GROUP BY Email_Domain__c ^ ERROR at Row:5:Column:12 field 'Email_Domain__c' can not be grouped in a query call

Is there a way form to GROUP BY a custom field?

UPDATE

When I check this field in workbench, it has these 2 properties

calculatedFormula: RIGHT(Email,((LEN(Email)-(FIND("@",Email)))))

groupable: false