Grouping keys configuration
Grouping keys configuration to control how Charge Segments roll up into Salesforce Opportunity Products using preset and custom key fields.
Grouping keys determine how Charge Segments are combined into Opportunity Products.
0 keys: Each Charge Segment creates its own Opportunity Products (1:1 mapping).
1–3 keys: Segments that share the same key values are rolled up into a single Opportunity Product.
Available preset keys (6):
| Key | Source | What It Does |
|---|---|---|
| Charge Number | Charge Segment | Closest to 1:1 charge-to-Opportunity Products mapping. |
| Quote Rate Plan (QRP Id) | Quote Rate Plan Charge → QRP | Group by rate plan. useful for aligning with order actions/amendments. |
| Product (Product2 Id) | QRP → Product | Group all charges for same product. |
| Product Type | Product2.zqu__ProductType__c | Group by: standalone hard_bundle |
| Product Category | Product2.zqu__Category__c | Group by product classification such as: Base Products Add On Services Miscellaneous Products |
Custom Keys (up to 4 slots):
| Slot | Source Object |
|---|---|
| Custom Field 1 | Charge Segment |
Custom field requirements:
The field type must be groupable (Text, Picklist, Id, Number).
Long Text Area or Rich Text fields are not supported.
The running user must have read access to the underlying field.
Do not select the same field in more than one custom key slot.
Example configurations:
| Use case | Keys | Result |
|---|---|---|
| Detailed line items | Charge Number | ~1 Opportunity Products per charge |
| Product rollup | Product | All charges for the same product → 1 Opportunity Product |
| Revenue recognition | Product + Product Type | Grouped by product and category |
| Regional rollup | Product + custom Region field | Grouped by product and region |
Grouping keys can be exported from one Salesforce org and imported into another using Data Loader or Workbench.
To export, query the source org:
SELECT zqu__KeyType__c, zqu__PresetField__c, zqu__CustomFieldApiName__c, zqu__SourceObject__c, zqu__SortOrder__c, zqu__IsActive__c, zqu__QuoteType__cFROM zqu__OppProdSyncGroupingKey__cWHERE zqu__IsActive__c = trueORDER BY zqu__SortOrder__c ASCTo import, delete existing active grouping keys in the target org first, then insert the exported rows. Grouping keys do not have a unique external ID, so upsert is not supported — use delete-then-insert instead.
Custom grouping keys that reference a custom field (Key Type = Custom) require that the same custom field exists and is accessible on the target org's Charge Segment object.