[Master]-Chance of success % does not validate correctly when using the action type "Update" in OpportunityChanges#8918
Conversation
| TempSalesCycleStageNext.FindFirst(); | ||
| "Sales Cycle Stage" := TempSalesCycleStageNext.Stage; | ||
| "Sales Cycle Stage Description" := TempSalesCycleStageNext.Description; | ||
| "Chances of Success %" := TempSalesCycleStageFirst."Chances of Success %"; |
There was a problem hiding this comment.
In the 'Next' branch of WizardActionTypeValidate2, "Chances of Success %" is assigned from TempSalesCycleStageFirst."Chances of Success %" instead of TempSalesCycleStageNext."Chances of Success %".
Every other field in this branch (Stage, Description) correctly uses TempSalesCycleStageNext. The same copy-paste pattern applies to the Previous, Skip, and Jump branches. The new test ChancesOfSuccessRevertsToCurrentStageOnActionTypeUpdate directly demonstrates the bug: it asserts Stage2Chances after a Next action, but the code will return Stage1Chances (from TempSalesCycleStageFirst).
Recommendation:
- change TempSalesCycleStageFirst to TempSalesCycleStageNext on this line; apply the same correction to the Previous, Skip, and Jump branches (use their respective TempSalesCycleStagePrevious, TempSalesCycleStageSkip, TempSalesCycleStageJump variables). The Update branch intentionally uses TempSalesCycleStageFirst to revert to the current stage and should remain unchanged.
| "Chances of Success %" := TempSalesCycleStageFirst."Chances of Success %"; | |
| "Chances of Success %" := TempSalesCycleStageNext."Chances of Success %"; |
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
| TempSalesCycleStagePrevious.FindFirst(); | ||
| "Sales Cycle Stage" := TempSalesCycleStagePrevious.Stage; | ||
| "Sales Cycle Stage Description" := TempSalesCycleStagePrevious.Description; | ||
| "Chances of Success %" := TempSalesCycleStageFirst."Chances of Success %"; |
There was a problem hiding this comment.
In the 'Previous' branch of WizardActionTypeValidate2, "Chances of Success %" is assigned from TempSalesCycleStageFirst."Chances of Success %" instead of TempSalesCycleStagePrevious."Chances of Success %".
The Stage and Description fields in this same branch correctly use TempSalesCycleStagePrevious, making this a copy-paste omission.
Recommendation:
- replace TempSalesCycleStageFirst with TempSalesCycleStagePrevious on this line so the Chances of Success percentage reflects the target previous stage, consistent with how Stage and Description are set.
| "Chances of Success %" := TempSalesCycleStageFirst."Chances of Success %"; | |
| "Chances of Success %" := TempSalesCycleStagePrevious."Chances of Success %"; |
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
| TempSalesCycleStageSkip.FindFirst(); | ||
| "Sales Cycle Stage" := TempSalesCycleStageSkip.Stage; | ||
| "Sales Cycle Stage Description" := TempSalesCycleStageSkip.Description; | ||
| "Chances of Success %" := TempSalesCycleStageFirst."Chances of Success %"; |
There was a problem hiding this comment.
In the 'Skip' branch of WizardActionTypeValidate2, "Chances of Success %" is assigned from TempSalesCycleStageFirst."Chances of Success %" instead of TempSalesCycleStageSkip."Chances of Success %".
Stage and Description in this branch correctly use TempSalesCycleStageSkip.
Recommendation:
- replace TempSalesCycleStageFirst with TempSalesCycleStageSkip on this line.
| "Chances of Success %" := TempSalesCycleStageFirst."Chances of Success %"; | |
| "Chances of Success %" := TempSalesCycleStageSkip."Chances of Success %"; |
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
| TempSalesCycleStageJump.FindLast(); | ||
| "Sales Cycle Stage" := TempSalesCycleStageJump.Stage; | ||
| "Sales Cycle Stage Description" := TempSalesCycleStageJump.Description; | ||
| "Chances of Success %" := TempSalesCycleStageFirst."Chances of Success %"; |
There was a problem hiding this comment.
In the 'Jump' branch of WizardActionTypeValidate2, "Chances of Success %" is assigned from TempSalesCycleStageFirst."Chances of Success %" instead of TempSalesCycleStageJump."Chances of Success %".
Stage and Description in this branch correctly use TempSalesCycleStageJump (via FindLast).
Recommendation:
- replace TempSalesCycleStageFirst with TempSalesCycleStageJump on this line.
| "Chances of Success %" := TempSalesCycleStageFirst."Chances of Success %"; | |
| "Chances of Success %" := TempSalesCycleStageJump."Chances of Success %"; |
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Copilot PR ReviewIteration 2 · Outcome: no-knowledge
Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 No findings were posted for this iteration. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
|
@DeepsShukla Please change the name of your branch to exclude the |
Agentic PR Review - Round 1Recommendation: Request ChangesWhat this PR doesThis PR tries to make the Update Opportunity wizard reset SuggestionsS1 - Wrong stage source for chance value S2 - Random test values can hide regression Risk assessment and necessityRisk: The change is narrow to the Update Opportunity wizard and does not change public APIs or event signatures. The regression surface is CRM opportunity updates: an incorrect chance value changes probability and calculated current value for an opportunity. Necessity: The change is required because users can save the wrong
|
alexei-dobriansky
left a comment
There was a problem hiding this comment.
please address the suggestions
Workitem Bug 640926: [master] [ALL-E] Chance of success % does not validate correctly when using the action type "Update" in Opportunity
AB#640926