This error usually means the workflow or action script is trying to do “in-transaction” operations in a context where NetSuite does not consider a live transaction session. Most common culprit is a Workflow Action Script using currentRecord or UI-style apply logic. Fix is to handle the apply in a true server pattern (load the Credit Memo, set the Apply sublist, save), or split it into two steps so the apply happens after the CM is fully created.