Rollup Summary Setup
Prerequisites
-
To set up rollup summary fields, you need:
-
Minimum permissions for the FieldFX modules you are using
-
System permissions:
-
API Enabled
-
Author Apex
-
Customize Application
-
View Setup and Configuration
-
-
-
To use rollup summary fields in FieldFX Mobile, you must use one of the following release channels:
-
Sync V4 Beta
-
Sync V4
-
V4 Quarterly Beta
-
V4 Quarterly
-
Basics
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
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
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
-
Click Next
-
In Field Label, enter "Number of Items"
-
Click Next
-
In Summarized Object, select "Ticket Items"
-
Under Select Rollup Type, select COUNT
-
Click Next
-
Click Visible twice
-
Click Next
-
Select the page layouts on which to include the field
-
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
-
Click Next
-
In Field Label, enter "Cost of Items"
-
Click Next
-
In Summarized Object, select "Ticket Items"
-
Under Select Rollup Type, select SUM
-
In Field to Aggregate, select "Cost"
-
Click Next
-
Click Visible twice
-
Click Next
-
Select the page layouts on which to include the field
-
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
-
Click Next
-
In Field Label, enter "Lowest Price"
-
Click Next
-
In Summarized Object, select "Quote Items"
-
Under Select Rollup Type, select MIN
-
In Field to Aggregate, select "Extended Amount"
-
Click Next
-
Click Visible twice
-
Click Next
-
Select the page layouts on which to include the field
-
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 guide 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
-
Click Next
-
In Field Label, enter "Highest Price"
-
Click Next
-
In Summarized Object, select "Quote Items"
-
Under Select Rollup Type, select MAX
-
In Field to Aggregate, select "Extended Amount"
-
Click Next
-
Click Visible twice
-
Click Next
-
Select the page layouts on which to include the field
-
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
-
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
Basics
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:
-
equals
-
notEqual
-
lessThan
-
greaterThan
-
lessOrEqual
-
greaterOrEqual
-
contains
-
notContain
-
startsWith
-
includes
-
excludes
FieldFX does not support the within operator. |
Refer to the 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:
For example,
https://na43.salesforce.com
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 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.
-