Rollup Summary Setup
Introduction
Rollup summary fields display calculated values from related records.
Use a rollup summary field to display the number of tickets on a job.
There are four types of rollup summary:
Type | Description |
---|---|
COUNT |
Totals the number of records |
SUM |
Totals the values in a number, currency, or percent field |
MIN |
Displays the lowest value in a number, currency, percent, date, or date/time field |
MAX |
Displays the highest value in a number, currency, percent, date, or date/time field |
When you add a rollup summary, you must:
-
Add the field to layouts
-
Grant field permissions
-
Add the field to the FX_Mobile_Rollups file
Prerequisites
To setup and use rollup summary fields, you need to:
Have these user licenses | Have these permissions | Complete these tasks and review these topics before continuing |
---|---|---|
N/A |
|
|
Considerations
Rollup summary fields in FieldFX Back Office, calculate values by analyzing all records.
Rollup summary fields in FieldFX Mobile calculate values by analyzing syncable records.
The value in a rollup summary in FieldFX Back Office, may differ from the value in the same field in FieldFX Mobile. |
Rollup Summary Fields
This section shows how you can add a Rollup Summary for a COUNT, SUM, MIN, and MAX.
Adding a COUNT Rollup Summary
This guide explains how to add a COUNT rollup summary field to the Ticket object.
This rollup summary displays the total number of ticket items on a ticket.
-
Add a Number of Items rollup summary to the Ticket object:
-
From Setup, enter
object
in the Quick Find box, then select Objects. -
Click Ticket.
-
Under Custom Fields & Relationships, click New.
-
Select Rollup Summary and click Next.
-
In Field Label, enter
Number of Items
and click Next. -
In Summarized Object, select "Ticket Items".
-
Under Select Rollup Type, select COUNT and click Next.
-
Click Visible twice and click Next.
-
Select the page layouts on which to include the field and click Save.
-
Grant permissions for the Number of Items field.
-
Add an FX_Mobile_Rollups static resource:
-
Open a text editor.
-
Enter the following on the first two lines:
[ {
-
Enter the type of rollup summary you are adding:
[ { "summaryOperation":"count", } ]
-
Enter the master-detail relationship for the rollup summary field:
[ { "summaryOperation":"count", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", } ]
-
Specify that the rollup summary doesn’t analyze data from a specific field:
[ { "summaryOperation":"count", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":null, } ]
-
Enter the object on which you added the rollup summary:
[ { "summaryOperation":"count", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":null, "sObjType":"FX5__Ticket__c", } ]
-
Enter the API name of the rollup summary:
[ { "summaryOperation":"count", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":null, "sObjType":"FX5__Ticket__c", "fieldName":"Number_of_Items__c" } ]
-
Enter the following on the last two lines:
[ { "summaryOperation":"count", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":null, "sObjType":"FX5__Ticket__c", "fieldName":"Number_of_Items__c" } ]
-
Every left brace
{
should have a matching right brace}
. -
Enter
},
to separate entries for multiple rollup summary fields and always enter}
after the last entry in the file.
-
-
Save the file with "FX_Mobile_Rollups" as the file name.
-
-
Upload the FX_Mobile_Rollups file to FieldFX Back Office:
-
From Setup, enter
static
in the Quick Find box, then select Static Resources. -
Click New.
-
In Name, enter
FX_Mobile_Rollups
. -
In Cache Control, select "Public".
-
Click Choose File.
-
Select the FX_Mobile_Rollups file.
-
Click Save.
When you upload an FX_Mobile_Rollups file, the settings in the file replace any existing settings.
-
Get all FieldFX Mobile users to sync.
Adding a SUM Rollup Summary
This guide explains how to add a SUM rollup summary field to the Ticket object.
This rollup summary displays the total cost of ticket items on a ticket.
-
Add a Cost of Items rollup summary to the Ticket object:
-
From Setup, enter
object
in the Quick Find box, then select Objects. -
Click Ticket.
-
Under Custom Fields & Relationships, click New.
-
Select Rollup Summary and click Next
-
In Field Label, enter
Cost of Items
and click Next -
In Summarized Object, select "Ticket Items".
-
Under Select Rollup Type, select SUM.
-
In Field to Aggregate, select "Cost" and click Next.
-
Click Visible twice and click Next.
-
Select the page layouts on which to include the field and click Save.
-
Grant permissions for the Cost of Items field.
-
Add an FX_Mobile_Rollups static resource:
-
Open a text editor.
-
Enter the following on the first two lines:
[ {
-
Enter the type of rollup summary you are adding:
[ { "summaryOperation":"sum", } ]
-
Enter the master-detail relationship for the rollup summary field:
[ { "summaryOperation":"sum", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", } ]
-
Enter the field for which to total values:
[ { "summaryOperation":"sum", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":"FX5__Ticket_Item__c.FX5__Cost__c", } ]
-
Enter the object on which you added the rollup summary:
[ { "summaryOperation":"sum", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":"FX5__Ticket_Item__c.FX5__Cost__c", "sObjType":"FX5__Ticket__c", } ]
-
Enter the API name of the rollup summary:
[ { "summaryOperation":"sum", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":"FX5__Ticket_Item__c.FX5__Cost__c", "sObjType":"FX5__Ticket__c", "fieldName":"Cost_of_Items__c" } ]
-
Enter the following on the last two lines:
[ { "summaryOperation":"sum", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":"FX5__Ticket_Item__c.FX5__Cost__c", "sObjType":"FX5__Ticket__c", "fieldName":"Cost_of_Items__c" } ]
-
Every left brace
{
should have a matching right brace}
. -
Enter
},
to separate entries for multiple rollup summary fields and always enter}
after the last entry in the file.
-
-
Save the file with "FX_Mobile_Rollups" as the file name.
-
-
Upload the FX_Mobile_Rollups file to FieldFX Back Office:
-
From Setup, enter
static
in the Quick Find box, then select Static Resources. -
Click New.
-
In Name, enter
FX_Mobile_Rollups
. -
In Cache Control, select "Public".
-
Click Choose File.
-
Select the FX_Mobile_Rollups file.
-
Click Save.
When you upload an FX_Mobile_Rollups file, the settings in the file replace any existing settings.
-
Get all FieldFX Mobile users to sync.
Adding a MIN Rollup Summary
This guide explains how to add a MIN rollup summary field to the Quote object.
This rollup summary displays the lowest price of a quote item on a quote.
-
Add a Lowest Price rollup summary to the Quote object:
-
From Setup, enter
object
in the Quick Find box, then select Objects. -
Click Quote.
-
Under Custom Fields & Relationships, click New.
-
Select Rollup Summary and click Next.
-
In Field Label, enter
Lowest Price
and click Next*s.. In *Summarized Object, select "Quote Items" -
Under Select Rollup Type, select MIN.
-
In Field to Aggregate, select "Extended Amount" and click Next.
-
Click Visible twice and click Next
-
Select the page layouts on which to include the field and click Save.
-
Grant permissions for the Lowest Price field.
-
Add an FX_Mobile_Rollups static resource:
-
Open a text editor.
-
Enter the following on the first two lines:
[ {
-
Enter the type of rollup summary you are adding:
[ { "summaryOperation":"min", } ]
-
Enter the master-detail relationship for the rollup summary field:
[ { "summaryOperation":"min", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", } ]
-
Enter the field for which to total values:
[ { "summaryOperation":"min", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", "summarizedField":"FX5__Quote_Item__c.FX5__Extended_Amount__c", } ]
-
Enter the object on which you added the rollup summary:
[ { "summaryOperation":"min", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", "summarizedField":"FX5__Quote_Item__c.FX5__Extended_Amount__c", "sObjType":"FX5__Quote__c", } ]
-
Enter the API name of the rollup summary:
[ { "summaryOperation":"min", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", "summarizedField":"FX5__Quote_Item__c.FX5__Extended_Amount__c", "sObjType":"FX5__Quote__c", "fieldName":"Lowest_Price__c" } ]
-
Enter the following on the last two lines:
[ { "summaryOperation":"min", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", "summarizedField":"FX5__Quote_Item__c.FX5__Extended_Amount__c", "sObjType":"FX5__Quote__c", "fieldName":"Lowest_Price__c" } ]
-
Every left brace
{
should have a matching right brace}
. -
Enter
},
to separate entries for multiple rollup summary fields and always enter}
after the last entry in the file.
-
-
Save the file with "FX_Mobile_Rollups" as the file name.
-
-
Upload the FX_Mobile_Rollups file to FieldFX Back Office:
-
From Setup, enter
static
in the Quick Find box, then select Static Resources. -
Click New.
-
In Name, enter
FX_Mobile_Rollups
. -
In Cache Control, select "Public".
-
Click Choose File.
-
Select the FX_Mobile_Rollups file.
-
Click Save.
When you upload an FX_Mobile_Rollups file, the settings in the file replace any existing settings.
-
Get all FieldFX Mobile users to sync
Adding a MAX Rollup Summary
This section explains how to add a MAX rollup summary field to the Quote object.
This rollup summary displays the highest price of a quote item on a quote.
-
Add a Highest Price rollup summary to the Quote object:
-
From Setup, enter
object
in the Quick Find box, then select Objects. -
Click Quote.
-
Under Custom Fields & Relationships, click New.
-
Select Rollup Summary and click Next
-
In Field Label, enter
Highest Price
and click Next. -
In Summarized Object, select "Quote Items".
-
Under Select Rollup Type, select MAX.
-
In Field to Aggregate, select "Extended Amount" and click Next.
-
Click Visible twice and click Next
-
Select the page layouts on which to include the field and click Save.
-
Grant permissions for the Highest Price field.
-
Add an FX_Mobile_Rollups static resource:
-
Open a text editor.
-
Enter the following on the first two lines:
[ {
-
Enter the type of rollup summary you are adding:
[ { "summaryOperation":"max", } ]
-
Enter the master-detail relationship for the rollup summary field:
[ { "summaryOperation":"max", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", } ]
-
Enter the field for which to total values:
[ { "summaryOperation":"max", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", "summarizedField":"FX5__Quote_Item__c.FX5__Extended_Amount__c", } ]
-
Enter the object on which you added the rollup summary:
[ { "summaryOperation":"max", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", "summarizedField":"FX5__Quote_Item__c.FX5__Extended_Amount__c", "sObjType":"FX5__Quote__c", } ]
-
Enter the API name of the rollup summary:
[ { "summaryOperation":"max", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", "summarizedField":"FX5__Quote_Item__c.FX5__Extended_Amount__c", "sObjType":"FX5__Quote__c", "fieldName":"Highest_Price__c" } ]
-
Enter the following on the last two lines:
[ { "summaryOperation":"max", "summaryForeignKey":"FX5__Quote_Item__c.FX5__Quote__c", "summarizedField":"FX5__Quote_Item__c.FX5__Extended_Amount__c", "sObjType":"FX5__Quote__c", "fieldName":"Highest_Price__c" } ]
-
Every left brace
{
should have a matching right brace}
. -
Enter
},
to separate entries for multiple rollup summary fields and always enter}
after the last entry in the file.
-
-
Save the file with
FX_Mobile_Rollups
as the file name.
-
-
Upload the FX_Mobile_Rollups file to FieldFX Back Office:
-
From Setup, enter
static
in the Quick Find box, then select Static Resources. -
Click New.
-
In Name, enter
FX_Mobile_Rollups
. -
In Cache Control, select "Public".
-
Click Choose File.
-
Select the FX_Mobile_Rollups file and click Save.
When you upload an FX_Mobile_Rollups file, the settings in the file replace any existing settings.
-
Get all FieldFX Mobile users to sync
Filters
Filters control the records analyzed in rollup summary calculations.
Use filters if you want rollups to display data for specific record types or for records matching specific criteria.
FieldFX supports the use of the following operators within filters:
|
|
|
FieldFX does not support the within operator. |
Refer to the Salesforce Help: Filter Operators Reference article for more information about the supported operators. |
Examples
The following examples present how to use a few of the supported operators.
Use the common syntax elements in these examples to learn to write custom filters that best support your organization. |
Automatically Added Quote Items
This filter excludes quote items added to a quote automatically.
{
"field": "FX5__Quote_Item__c.FX5__Auto_Added__c",
"operation": "equals",
"value": false
}
Field Value
This filter excludes ticket items with an Input Qty of 3 or less.
{
"field": "FX5_Ticket_Item__c.FX5__Input_Qty__c",
"operation": "greaterThan",
"value": 3
}
Items Not on Standby
This filter excludes ticket items that have On Standby selected.
{
"field": "FX5__Ticket_Item__c.FX5__On_Standby__c",
"operation": "equals",
"value": false
}
Record Type
This filter excludes quote items that don’t have the Labor record type.
{
"field": "FX5__Quote_Item__c.RecordTypeId",
"operation": "equals",
"value": "012F0000000oOOlIAM"
}
|
Multiple Criteria
This filter excludes tickets that aren’t for the Broussard office and don’t have the Offshore checkbox selected.
{
"field": "FX5__Ticket__c.FX5__Office__c",
"operation": "equals",
"value": "Broussard"
},
{
"field": "FX5__Ticket__c.Offshore__c",
"operation": "equals",
"value": false
}
-
This filter excludes tickets that don’t match two specific values (AND statement).
-
Add a comma to separate criteria but don’t add a comma after the last criterion.
Adding a Filter to a Rollup Summary
This guide explains how to add a filter to exclude ticket items from a rollup summary calculation that don’t have the Labor record type.
-
Add the filter to the rollup summary field:
-
From Setup, enter
object
in the Quick Find box, then select Objects. -
Click Ticket.
-
Under Custom Fields & Relationships, click the name of the rollup summary.
-
Click Edit.
-
Under Filter Criteria, select Only records meeting certain criteria should be included in the calculation.
-
Enter the following criteria:
-
Field: Record Type
-
Operator: equals
-
Value: True
-
-
Click Save.
-
Add the filter to the FX_Mobile_Rollups static resource:
-
Open the FX_Mobile_Rollups file in a text editor.
-
Locate the entry for the rollup summary.
[ { "summaryOperation":"sum", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":"FX5__Ticket_Item__c.FX5__Cost__c", "sObjType":"FX5__Ticket__c", "fieldName":"Cost_of_Items__c" } ]
-
Add the following code to filter the rollup summary by the Labor record type:
[ { "summaryOperation":"sum", "summaryForeignKey":"FX5__Ticket_Item__c.FX5__Ticket__c", "summarizedField":"FX5__Ticket_Item__c.FX5__Cost__c", "sObjType":"FX5__Ticket__c", "fieldName":"Cost_of_Items__c", "summaryFilterItems": [ { "field": "FX5__Ticket_Item__c.RecordTypeId", "operation": "equals", "value": "012F0000000oOOlIAM" } ] } ]
-
012F0000000oOOlIAM
is the 18-digit case insensitive ID for the Labor record type. -
You must use the 18-digit case insensitive ID to represent a record type in a filter.
-
Don’t use the 15-digit case sensitive ID or the record type name to represent a record type in a filter.
-
-
Save the file with
FX_Mobile_Rollups
as the file name.
-
-
Upload the FX_Mobile_Rollups file to FieldFX Back Office:
-
From Setup, enter
static
in the Quick Find box, then select Static Resources. -
Click New.
-
In Name, enter
FX_Mobile_Rollups
. -
In Cache Control, select "Public".
-
Click Choose File.
-
Select the FX_Mobile_Rollups file.
When you upload an FX_Mobile_Rollups file, the settings in the file replace any existing settings.
-
Click Save
-
Get all FieldFX Mobile users to sync
Rollup Summary Builder
Basics
You must set up rollup summary fields in FieldFX Back Office and FieldFX Mobile separately.
The Rollup Summary Builder makes it easier to add rollups that work systemwide.
How It Works
When you run the Rollup Summary Builder, it:
-
Analyzes FieldFX Back Office to look for rollup summary fields.
-
Creates a new FX5__Mobile_Rollups static resource. containing every rollup summary in FieldFX Back Office.
-
Creates a backup copy of the current FX5__Mobile_Rollups file for your org.
-
Replaces the existing FX5Mobile_Rollups file with the new FX5Mobile_Rollups file.
-
Uploads the backup copy of the previous FX5__Mobile_Rollups file to the static resource. list for your org.
Once the Rollup Summary Builder uploads a new FX5_Mobile_Rollups file, the rollups listed in the file work systemwide.
Setting Up the Rollup Summary Builder
-
From Setup, enter
remote
in the Quick Find box, then select Remote Site Settings. -
Click New Remote Site.
-
In Remote Site Name, enter
SFDCToolingAPI
. -
In Remote Site URL, enter the domain in which your org runs.
To get the URL for your domain, copy the first part of the URL from the address bar in your browser:
Use your customized my domain URL that is specific to your org instead of your instance specific URL. You can find your my domain here.
Don’t use instanced URLs when logging in to Salesforce with code or as a user. When your org is moved to another Salesforce instance, code using the instanced URL breaks. If you find instanced URLs in your code, replace them with your My Domain login URL or the default Salesforce login URL. See Log In to Salesforce with Code for more information.
The Remote Site URL field is case-sensitive.Make sure the URL you enter uses the correct capitalization. |
-
Click Active.
-
Click Save.
-
Complete one of the following:
Scheduling the Rollup Summary Builder to Run Automatically
Prerequisite
-
From Setup, enter
apex
in the Quick Find box, then select Apex Classes. -
Click Schedule Apex.
-
In Job Name, enter
Rollup Summary Builder
. -
In Apex Class, select "RollupInfoHandler".
-
Select how often you want the Rollup Summary Builder to run.
Select a frequency of at least once per week. -
Click Save.
Running the Rollup Summary Builder Manually
Prerequisite
-
Select Utilities | Apex Execute.
-
Enter the following script:
System.debug(FX5.FXWorkerLauncher.DoWork('FX5.RollupInfoHandler', null));
-
Click Execute.
The Rollup Summary Builder:
-
Analyzes FieldFX Back Office to look for rollup summary fields.
-
Creates a new FX5__Mobile_Rollups static resource containing every rollup summary in FieldFX Back Office.
-
Creates a backup copy of the current FX5__Mobile_Rollups file for your org.
-
Replaces the existing FX5__Mobile_Rollups file with the new FX5__Mobile_Rollups file.
-
Uploads the backup copy of the previous FX5__Mobile_Rollups file to the static resource. list for your org.
-