Valid PDII Dumps shared by ExamDiscuss.com for Helping Passing PDII Exam! ExamDiscuss.com now offer the newest PDII exam dumps, the ExamDiscuss.com PDII exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PDII dumps with Test Engine here:
An org has a Process Builder process on Opportunity that sets a custom field,CommissionBaseAmount__c, when an Opportunity is edited and the Opportunity's Amount changes. A developer recently deployed an Opportunity before update trigger that uses the CommissionBaseAmount__c and complex logic to calculate a value for a custom field CommissionAmount_c, when an Opportunity stage changes to Closed/Won. Users report that when they change the Opportunity to Closed/Won and also change the Amount during the same save, the C:rr.i;5icnA.T.cur.t c is incorrect. Which two actions should the developer take to correct this problem? Choose 2 answers
Correct Answer: A,C
Recent Comments (The most recent comments are at the top.)
Igris - Jun 26, 2025
An org has an existing process, built using Process Builder, on Opportunity that sets a custom field, CcommissionBaseAmount _c, when an Opportunity is edited and the Opportunity's Amount changes. A developer recently deployed an Opportunity before update trigger that uses the CommissionBaseAmount__c and complex logic to calculate a value for a custom field, CommissionAmount c, when an Opportunity stage changes to Closed/Won. Users report that when they change the Opportunity to Closed/Won and also change the Amount during the same save, the CommissionAmount __c is incorrect. Which action should the developer take to correct this problem?
A. Replace the process with a Fast Field Update record-trigger flow. B. Call the trigger from the process, C. Call the process from the trigger.
other version of this question . Ans is A for this question.
Fa3il khayr - Nov 06, 2024
The correct answers are:
C. Use a static Boolean variable in the trigger. D. Uncheck the recursion checkbox on the process.
Explanation: When working with both Process Builder and triggers, conflicts can arise due to recursive updates, especially when both are trying to modify related fields within the same transaction. Here’s how each of the correct answers addresses the issue:
C. Use a static Boolean variable in the trigger Adding a static Boolean variable to the trigger can prevent the trigger from running recursively. A static variable can be set to true when the trigger runs the first time, and subsequent executions in the same transaction can skip the trigger logic by checking this variable. This approach helps ensure that the trigger logic is executed only once in a single transaction, preventing issues like unexpected updates to CommissionAmount__c.
D. Uncheck the recursion checkbox on the process Unchecking the recursion setting in Process Builder prevents the process from re-triggering itself or any dependent logic (like the trigger) when fields it updates are subsequently modified by other processes or triggers in the same transaction. By turning off recursion, you reduce the risk of infinite loops or unexpected field updates, ensuring that the CommissionBaseAmount__c field is set only once per transaction , reference : https://sf9to5.com/2019/09/17/when-use-recursion-checkbox-process-builder/
Why Not the Other Options?
A. Call the trigger from the process: This is not feasible. Triggers are automatically invoked by data changes; there is no way to directly call a trigger from Process Builder.
B. Call the process from the trigger: Triggers cannot explicitly invoke Process Builder processes. Processes are declarative and triggered by data changes rather than by explicit Apex calls....
Mauricio - Sep 18, 2023
To correct the problem of the incorrect commission amount on the opportunity. According to the Salesforce documentation(1), the order of execution of triggers and processes is as follows:
-Executes all before triggers. -Executes all after triggers. -Executes processes and flows launched via Process Builder and Flow Builder.
This means that in your scenario, the trigger runs before the process, and therefore it uses the old value of CommissionBaseAmount__c to calculate the CommissionAmount__c, instead of the updated value that the process sets. To fix this problem, you can take the following two actions:
- Call the process from the trigger. You can use the Process.Plugin class to invoke a process from Apex code2. This way, you can ensure that the process runs before the trigger logic, and that the trigger uses the updated value of CommissionBaseAmount__c.
- Use a static Boolean variable in the trigger. You can use a static Boolean variable to prevent the trigger from running more than once in a single transaction3. This way, you can avoid any unwanted side effects or recursion issues that may occur when calling a process from a trigger.
Recent Comments (The most recent comments are at the top.)
An org has an existing process, built using Process Builder, on Opportunity that sets a custom field, CcommissionBaseAmount _c, when
an Opportunity is edited and the Opportunity's Amount changes.
A developer recently deployed an Opportunity before update trigger that uses the CommissionBaseAmount__c and complex logic to calculate a
value for a custom field, CommissionAmount c, when an Opportunity stage changes to Closed/Won.
Users report that when they change the Opportunity to Closed/Won and also change the Amount during the same save,
the CommissionAmount __c is incorrect.
Which action should the developer take to correct this problem?
A. Replace the process with a Fast Field Update record-trigger flow.
B. Call the trigger from the process,
C. Call the process from the trigger.
other version of this question .
Ans is A for this question.
The correct answers are:
C. Use a static Boolean variable in the trigger.
D. Uncheck the recursion checkbox on the process.
Explanation:
When working with both Process Builder and triggers, conflicts can arise due to recursive updates, especially when both are trying to modify related fields within the same transaction. Here’s how each of the correct answers addresses the issue:
C. Use a static Boolean variable in the trigger
Adding a static Boolean variable to the trigger can prevent the trigger from running recursively.
A static variable can be set to true when the trigger runs the first time, and subsequent executions in the same transaction can skip the trigger logic by checking this variable.
This approach helps ensure that the trigger logic is executed only once in a single transaction, preventing issues like unexpected updates to CommissionAmount__c.
D. Uncheck the recursion checkbox on the process
Unchecking the recursion setting in Process Builder prevents the process from re-triggering itself or any dependent logic (like the trigger) when fields it updates are subsequently modified by other processes or triggers in the same transaction.
By turning off recursion, you reduce the risk of infinite loops or unexpected field updates, ensuring that the CommissionBaseAmount__c field is set only once per transaction , reference : https://sf9to5.com/2019/09/17/when-use-recursion-checkbox-process-builder/
Why Not the Other Options?
A. Call the trigger from the process: This is not feasible. Triggers are automatically invoked by data changes; there is no way to directly call a trigger from Process Builder.
B. Call the process from the trigger: Triggers cannot explicitly invoke Process Builder processes. Processes are declarative and triggered by data changes rather than by explicit Apex calls....
To correct the problem of the incorrect commission amount on the opportunity. According to the Salesforce documentation(1), the order of execution of triggers and processes is as follows:
-Executes all before triggers.
-Executes all after triggers.
-Executes processes and flows launched via Process Builder and Flow Builder.
This means that in your scenario, the trigger runs before the process, and therefore it uses the old value of CommissionBaseAmount__c to calculate the CommissionAmount__c, instead of the updated value that the process sets. To fix this problem, you can take the following two actions:
- Call the process from the trigger. You can use the Process.Plugin class to invoke a process from Apex code2. This way, you can ensure that the process runs before the trigger logic, and that the trigger uses the updated value of CommissionBaseAmount__c.
- Use a static Boolean variable in the trigger. You can use a static Boolean variable to prevent the trigger from running more than once in a single transaction3. This way, you can avoid any unwanted side effects or recursion issues that may occur when calling a process from a trigger.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm...