Result Record Creation: Bypassing Triggers
This document aims to aid users to guide while manual creation of Result Records.
Data Seeding
Data seeding, or data migration, automates the population of a database with initial/historical data for development, testing, or deployment. Salesforce tools like Dataloader.io enable efficient data loading (insert, upsert, delete), saving significant time and effort, especially during regression testing and setup.
Amp Impact's junction objects use Automated Triggers for data integrity and easier data management. Learn more about these triggers at: Automation: Triggers | Triggers in Amp Impact
Result Record Creation Process
Result Records store Target values and Result values. They are linked to Project Indicators (PI), Reporting Periods (RP), and Geographical Areas (GA). Multiple Result Records can be created for a single Project Indicator based on different combinations of Reporting Period and Geographic Area further expanded by Disaggregation Grouping.
Why do we need a Result Record Creation Process?
Sometimes, when uploading large amounts of data, triggers might need to be temporarily turned off to avoid unintended creation of result records or duplication of result records.
The triggers getting affected while creating Result Records are on the following objects:
1. Project Indicator Reporting Period
2. Project Indicator Geographic Area
3. Result
If triggers are turned off, you'll need to navigate the mapping between Project Indicators, Reporting Periods, Geographic Areas, and Disaggregation Groups. This document will help you correctly create Result Records in that scenario.
How to create Result Records?
For each Project Indicator, identify number of Reporting Periods, Geographic Areas and Disaggregation Groups involved. We simply need to map each Reporting Period with every Geographic Area for a single Project Indicator.
In case the Project indicator does not have any Disaggregation Groups:
Lets say Project Indicator X have Reporting Periods Q1 & Q2 and Geographic Areas NZ & AU. Then the mapping for:X’s Project Indicator Geographic Area (PIGA) Records include: X → NZ & X → AU (Sum:2)
X’s Project Indicator Reporting Period Records (PIRP) include: X → Q1 & X → Q2 (Sum:2)
X’s Result Records include: X → Q1 → NZ, X → Q1 → AU, X → Q2 → NZ & X → Q2 → AU. (Sum:4)
If Project indicators have Disaggregation Values (e.g., level 1, level 2), the number of result records increases further i.e., each Disaggregation Value needs its own set of combinations.
This is how you can create Result Records. Now let’s further look at the case examples for better clarity.
Case Examples
We are assuming Reporting Period is Monthly & Geographic Area is Country.
CASE I: No Disaggregation Groups
Project Indicator | Reporting Period | Geographic Area | PIGA | PIRP | Result |
PI1 | RP1 | GA1 | 1 | 1 | 1 |
|
| Total | 1 | 1 | 1 |
PI2 | RP1 | GA1 | 1 | 1 | 2 |
| RP2 | GA2 | 1 | 1 | 2 |
|
| Total | 2 | 2 | 4 |
PI3 | RP1 | GA1 | 1 | 1 | 3 |
| RP2 | GA2 | 1 | 1 | 3 |
| RP3 | GA3 | 1 | 1 | 3 |
|
| Total | 3 | 3 | 9 |
PI4 | RP1 | GA1 | 1 | 1 | 3 |
| RP2 | GA2 | 1 | 1 | 3 |
|
| GA3 | 1 |
|
|
|
| Total | 3 | 2 | 6 |
PI4 | RP1 | GA1 | 1 | 1 | 2 |
| RP2 | GA2 | 1 | 1 | 2 |
| RP3 |
|
| 1 | 2 |
|
| Total | 2 | 3 | 6 |
CASE II: With Disaggregation Groups
(1 x Disaggregation Group 2 x Disaggregation Value)
Disaggregation Group | Disaggregation Value | Project Indicator | Reporting Period | Geographic Area | PIGA | PIRP | Result |
DG1 | Level 1 | PI1 | RP1 | GA1 | 1 | 1 | 1 |
| Level 2 |
|
| Total | 1 | 1 | 2 |
DG1 | Level 1 | PI2 | RP1 | GA1 | 1 | 1 | 2 |
| Level 2 |
| RP2 | GA2 | 1 | 1 | 2 |
|
|
|
| Total | 2 | 2 | 8 |
DG1 | Level 1 | PI3 | RP1 | GA1 | 1 | 1 | 3 |
| Level 2 |
| RP2 | GA2 | 1 | 1 | 3 |
|
|
| RP3 | GA3 | 1 | 1 | 3 |
|
|
|
| Total | 3 | 3 | 18 |
DG1 | Level 1 | PI4 | RP1 | GA1 | 1 | 1 | 3 |
| Level 2 |
| RP2 | GA2 | 1 | 1 | 3 |
|
|
|
| GA3 |
| 1 |
|
|
|
|
| Total | 2 | 3 | 12 |
DG1 | Level 1 | PI4 | RP1 | GA1 | 1 | 1 | 2 |
| Level 2 |
| RP2 | GA2 | 1 | 1 | 2 |
|
|
| RP3 |
| 1 |
| 2 |
|
|
|
| Total | 3 | 2 | 12 |
In case of any queries, you can contact @divija agarwal/ @Vanashree Pinjari/@Sankalp Ghosh