Err - This action is not allowed as it is outside the current transaction
We are using Pega 7.2.2 and in one of the section we delete a work order - the delete operation has to save the contents including the attachments and when upon adding (+ mark) the deleted contents should be populated (not the deleted attachment). For this I have configuration (screenshot 1) and for this configuration when the delete is performed the error - "This action is not allowed as it is outside the current transaction" is displayed. As we have both delete and dosave in the action set it is causing this issue. But if I specify the obj-save on the pyWorkPage in the activity and remove the dosave from the action set, my actions are not getting saved. Any suggestions would be much appreciated.
Screenshot 2 is the icons which user clicks to perform deletion or addition of work orders. Same error was thrown in a different scenario and the Pega GCS team shared a script to embed in the same section where the issue is caused. It worked in that scenario but not in this (capture3 is the script).
Do you really need refresh harness. as per my previous observations "This action is not allowed as it is outside the current transaction" error will come only if current harness id do not match with previous harness id.
The above issue which I mentioned is very corner scenario - when the user opens the case and the very 1st action is deleting the work order (which is rare) then this error is thrown. In every other scenarios this works perfectly fine. If we have multiple work orders (tabs) and if we perform some other actions like entering the data and saving it or uploading an attachment etc. and then delete one of the work order then it doesn't throw this error.
Refresh harness is required as I'm removing the attachments as well, even it gets deleted until I refresh harness it doesn't get reflected. As I said if we remove the dosave from the action set then the error doesn't throw but the functionality doesn't work either.