+ Start a Discussion
Kenneth WangKenneth Wang 

How to fetch Filter Criteria under Roll-Up Summary Options?

I have created an rollup field, and added some Filter Criteria under its Roll-Up Summary Options tab. But I can't find the Filter Criteria in the Custom Field's metadata object through the Tooling API. Would you please let me know how to get it?
CustomField: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_customfield.htm
Mahesh DMahesh D
Hi Kenneth,

You can try using the summaryFilterItems.
 
<fields>
        <fullName>Objetivo_Ano_Actual__c</fullName>
        <externalId>false</externalId>
        <label>Objetivo Año Actual</label>
        <summarizedField>Objetivos__c.Objetivo__c</summarizedField>
        <summaryFilterItems>
            <field>Objetivos__c.Ano__c</field>
            <operation>equals</operation>
            <value>2015</value>
        </summaryFilterItems>
        <summaryForeignKey>Objetivos__c.Cliente__c</summaryForeignKey>
        <summaryOperation>sum</summaryOperation>
        <type>Summary</type>
    </fields>

Check the below links:

http://salesforce.stackexchange.com/questions/64428/can-a-value-of-an-object-filter-be-edited-by-apex-code

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm


Please do let me know if it helps you.

Regards,
Mahesh
Roy LuoRoy Luo
Kenneth,

Have you ever figured it out? I am in the same boat now. Somehow the customfield metadata only has summarizedField,, summaryForeignKey and summaryOperation and sadly lacks summaryFilterItems, while the sfdc document says summaryFilterItems is included, https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_customfield.htm. 

Thanks,
Roy
Roy LuoRoy Luo
I opened a support case a few days and SFDC confirmed it is a bug. Here is the issue page:
https://success.salesforce.com/issues_view?id=a1p3A000000eghpQAA

I was told the dev team is working on this issue and it should be fixed soon, but no ETA yet. 

Roy