Agg Model failing w/ "Field must be grouped or aggregated: Name" message



And the query generated using Service__c for grouping that works fine.

``` SELECT SUM(Starting_Hours__c) sumStartingHoursc,Service__c servicec,Service__r.Name servicerName FROM Task__c WHERE (Work__r.Sprint__c = 'a3oj0000000Xb5nAAC') GROUP BY Service__c,Service__r.Name
```
Using Work__c instead of Service__c for grouping should work just fine as well, but sadly no. :(

Pat, can you post the SOQL query generated when you’re using Work__c instead of Service__c? And also can you post the XML for the Model when it displays this error?

SELECT SUM(Starting_Hours__c) sumStartingHoursc,Work__c workc,Work__r.Name workrName FROM Task__c GROUP BY Work__c
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true"> <models> <model id="Services" limit="" query="false" createrowifnonefound="false" adapter="salesforce" type="aggregate" sobject="Task__c"> <fields> <field id="Starting_Hours__c" name="sumStartingHoursc" function="SUM"/> </fields> <conditions> <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Work__r.Sprint__c" state="filterableoff" inactive="true" name="Work__r.Sprint__c"/> </conditions> <actions/> <groupby method="simple"> <field id="Work__c" name="workc"/> <field id="Work__r.Name" name="workrName"/> </groupby> </model> <model id="Sprints" limit="20" query="true" createrowifnonefound="false" adapter="salesforce" type="" sobject="Sprint__c"> <fields> <field id="Name"/> <field id="Service_Order__c"/> <field id="Service_Order__r.Name"/> <field id="Service_Order__r.Account__c"/> <field id="Service_Order__r.Account__r.Name"/> <field id="Id"/> </fields> <conditions/> <actions/> </model> </models> <components> <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="all" createrecords="false" model="Services" buttonposition="" mode="readonly" uniqueid="sk-A7a8I-105"> <fields> <field id="Starting_Hours__c" name="sumStartingHoursc" decimalplaces="" valuehalign="" type=""> <label>Starting Hours</label> <summaries> <summary>sum</summary> </summaries> </field> </fields> <rowactions/> <massactions usefirstitemasdefault="true"/> <views> <view type="standard"/> </views> <filters> <filter type="select" filteroffoptionlabel="--- Any ---" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="manual" conditionfield="Work__r.Sprint__c" labelmode="no" condition="Work__r.Sprint__c"> <sources> <source type="model" effectsbehavior="justdefault" model="Sprints"> <labeltemplate>{{{Name}}} - {{Service_Order__r.Name}} - {{Service_Order__r.Account__r.Name}}</labeltemplate> <valuetemplate>{{Id}}</valuetemplate> </source> </sources> </filter> </filters> </skootable> </components> <resources> <labels/> <javascript/> <css/> </resources> <styles> <styleitem type="background" bgtype="none"/> </styles> </skuidpage>

Works when I remove the “workrName” grouping, but I need this value in the table to see the groupings.

Any luck figuring this out?

Not yet - I tried to replicate an identical setup and didn’t get the same error. What version of Skuid are you on where this is happening? 

8.10

Found the issue. The Name is Autonumber, which isn’t groupable. :frowning:

Yeah, this is rather annoying… we have to create workflow rules to copy the  auto number/name to a text field for use in aggregate groupings.

Glad to at least know what the issue is…