Introduction
I ran into a situation when trying to “Correct” or “Cancel” a Sales invoice generated the following error:
“Cancelling the invoice failed because of the following error:
Sales Credit Memo must be approved and released before you can perform this action.”
The error was occurring because I had a workflow configured for Sales Credit Memos however the client only wanted the workflow to trigger for manual credits, not for cancellations or corrections.
Therefore in order to prevent this I had to tweak the workflow condition as I’ll explain further in this post.
The Error
When trying to cancel or correct a posted sales invoice I’m presented with the following error:

I then have to open the credit memo and send it for approval. However in the clients scenario they want to bypass the workflow when creating a credit off the back of an invoice, so the credit note posts automatically.
The Fix
In order to prevent the error I had to figure out a way of bypassing the existing Sales Credit workflow by adding a condition to the workflow.
As part of my investigation I switched off the workflow and posted a correction on a Sales Invoice successfully. I then noticed the “Applies-to Doc. No.” field is automatically populated on the “Sales Cr. Memo Header” table as part of the correction process:

I therefore added the following condition to the workflow:

Now when cancelling or correcting an invoice the Sales Credit Workflow isn’t activated and the credit is created successfully.
Conclusion
Although it seems you overcome this situation by getting creative with the workflow conditions, I’d be interested to know if there are any other workarounds for this scenario.
Thanks for reading!