Issue
In Attach a document case step or widget, a custom validation is implemented to set a page-level error message when an invalid document is uploaded. After a validation failure, when you upload a valid document, pySameAsCurrentStage error is displayed.
Symptoms and Impact
Unable to upload a valid document, after attempting to upload an invalid document. You must refresh the work item to upload a new valid document.
Steps to reproduce
Perform the following steps to reproduce this issue:
- Implement custom attachment validation, such as modification of the OOTB CallVirusCheck extension point activity.
- Create a case.
- Attempt to attach a file that will fail the custom validation.
- After the validation failure is displayed, attempt to upload another file which should not fail the custom validation.
Root Cause
A defect in Pega’s code causes this issue.
The stage of the document object is already changed in Clipboard when the validation error is reported. Hence, the subsequent attempt to upload another file fails because the stage value remains the same.
Workaround
An enhancement request has been entered for this issue but has not yet been assigned to a specific release. This known issue will be updated with release details when the enhancement for this issue is available.
In the meantime, perform the following steps to avoid the issue:
- Perform a Save-As of the OOTB Work-.pyCaseMainInner section into an application ruleset.
- Update top embedded section configuration in the Utils layout to change the source from pyCaseRelatedContent to pyCaseAttachmentsTopWrapper.
- Save the pyCaseMainInner section with the change.