Support Article
Action not allowed as its outside the current transaction
SA-24909
Summary
When uploading documents, an error occurs.
Error Messages
This action is not allowed as it is outside the current transaction
Steps to Reproduce
Upload two documents one after the other quickly, using a custom attach process.
Root Cause
An issue in the custom application code or rules. It is generally bad practice to have an explicit call to the commit method in a custom activity, as is done in this application's custom process for attaching documents.
The custom attachment code is not properly hooked into the user interface, and even though a new pxClientExchange is generated and sent down to the client, the Server does not properly handle it.
As a result, the next usage of that pxClientExchange (as a pxTransactionID) fails with the given error.
Resolution
Eliminate the explicit commits and change the obj-save's to obj-save with Write Now selected. This will prevent the transaction id from changing.
Doing this has the side-effect of attaching the document immediately, but the audit trail (history records) does not get updated until normal flow processing advances the flow and the system-initiated commit takes place. It is possible to change the design of the application so that the two (the attachment and the audit trail) remain in synch, but that is up to the individual application to decide how to implement.
Published July 2, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.