what can couse the error:This record has been lock...
# ask-stanley-ai
u
what can couse the error:This record has been locked by a user defined workflow when trying to generate intercompany sales order?
c
AI generated answer (using internal Slack threads):
The error "This record has been locked by a user defined workflow" when trying to generate an intercompany sales order can be caused by a workflow that locks the record after it reaches a certain state. This is often done to prevent changes to the record after it has been approved or reached a certain stage in the process. However, this can cause issues when trying to read or manipulate the record, even if you're not trying to change any of the locked fields. This is because the lock applies to the entire record, not just the fields that have been changed. To resolve this issue, you can adjust the context of the Lock Record action in the workflow. Set the context to User Interface only, and unselect all other options. This will allow scripts and other non-UI processes to interact with the record without being blocked by the lock. In the event types, try selecting just 'view' and no other options. This will prevent the lock from blocking view operations, which are often necessary for scripts and other processes. Remember, when you apply a credit memo to an invoice it changes the invoice status to 'paid in full' which is considered editing the invoice. Since the lock record is preventing all changes you get the error. That’s why you only want the lock record to occur in certain contexts but not all contexts and events. Please note that if you select UI only, users can still edit the invoice via CSV import or any script. To prevent this, you may need to implement additional controls or restrictions. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.857191503
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837153494
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830106914
Please provide your feedback on this answer.