Three CRM automations passed their tests without running the code that had just changed

Four sales process automations in Dynamics 365 were repaired in one day. What made the day worth writing up is not the repairs, it is that three of them reported success while the branch they added had never executed once. Each fault was found by asking which test actually runs the new code, rather than […]

In this series · Part 9 of 27

1Dynamics 365 CRM: API integration + change-control repo2Dynamics 365 CRM: Last Contact Engagement tracking on Accounts3Turning a sales-intelligence export into a clean CRM data model4Dynamics 365 CRM: contacts inherit their company’s website, and emails timestamp by send time5Your SEO health now lives as a dashboard inside the CRM6Contact form duplicate detection now reads the request, not just the address7Marketing list members now show engagement and account fit8Campaign responses now create leads behind a confirmation step9Three CRM automations passed their tests without running the code that had just changed10A signature defect that three mailboxes agreed was not there11Why a corrected email signature kept sending the old one12A read-only CRM endpoint for scoring outside the desktop13Choosing what runs the AI layer in the CRM sales process14Asking whether a partner is involved, instead of inferring it15An email step in the sales process can now be excused, not only sent16The rehearsal that guards every process change had been failing silently17A one to one email from a lead left the engagement record blank18Two local dependencies, and only one was obvious19Filing a generated document to the record automatically20One meeting that served two process steps, recorded as two21A setting that stored correctly, read back correctly, and was never in force22Generating a product catalogue from one canonical file23Three date fields that existed on every row, and had never once been written24Unused, unreferenced, and still not safe to delete25A measure that could not record early26A sales automation that runs as itself, not as an administrator27A stage change that was refused, and reported as a success

On this page

Free Revenue Lifecycle Assessment

Connect with Marissa Wright to receive a free Revenue Lifecycle Assessment Report on your own business.

Book a consult →

Four sales process automations in Dynamics 365 were repaired in one day. What made the day worth writing up is not the repairs, it is that three of them reported success while the branch they added had never executed once. Each fault was found by asking which test actually runs the new code, rather than whether the test suite passes.

  • A branch that could not be reached by an empty value was being reached by one. Each automation reads a step field from the record that triggered it and matches it against a list of cases. When that field is empty the platform fails the whole evaluation before it attempts any match, and the default case does not catch it, because a default handles a value that matched nothing rather than the absence of a value. Two internal design documents had reasoned the opposite from the same definition. Both were wrong, and both are now corrected.
  • One of the four reported 200 runs and zero failures while carrying the identical defect. Its trigger only fires when a record moves into a closed state, and the records it watches are already closed when they arrive, so the faulty path was never entered. A clean failure count was evidence that the code had not run. It was not evidence that it worked, and reading it as such is how the same fault survived a fix applied to its sibling that morning.
  • One automation had been retired because its only working guard was accidental. It closed a process step whenever a note appeared whose subject contained a particular phrase and which carried an attachment. Nothing ever read the attachment. On the day it was examined, six unrelated notes on a single record matched the phrase, and the only reason the step did not close roughly 97 minutes early is that none of them happened to have a file attached. The trigger is now an explicit marker written by the process that completes the work.
  • The pattern behind all three was the same, and it is worth naming. Each change also updated the test harness in a way that stopped the harness reaching the new code. The sharpest case: a step that reopens a task when its evidence is missing had been failing on every attempt since it was written, because it set a status value this system does not define, and the same change that added it taught the harness to supply the evidence, so the harness always took the other path. Ask which test executes that specific branch, and be most suspicious when the test was edited alongside the code.