Hi All,
scenario:
we have OOTB file attachment where we can upload and download and delete the file ,these option we can give in visibility ,
but when we uploaded the file and we are in that particular screen where we can view or download or delete the file ,
1)we should get only the delete option until we are on that particular screen after upload ,once we submitted we should not able to delete it in next time
suppose we have two file uploaded now so we can delete both until we are not submitted but once we submit we should not able to delete ever ,in same screen again we uploaded any other file so we can delete current uploaded not old one
however we have Post or Pre activity to achieve it and even we can use flag but here we have everything OOTB ,final rules
can anyone have idea how we can achieve it
PEGA 8.8.5 provides OOTB functionality to restrict file deletion under certain conditions using the File Attachment component. Here’s how you can set it up:
Create a File Attachment component: Add a File Attachment component to your case type.
Configure Upload/Download Actions: In the File Attachment component’s properties, uncheck the “Allow Delete” option for the Upload and Download actions. This will prevent users from deleting files once they have been uploaded.
Configure the Allowed States: In the File Attachment component’s properties, add the following allowed states:
New: This state represents a newly uploaded file that can be deleted.
Submitted: This state represents a file that has been submitted and can no longer be deleted.
Set the Initial State: Set the initial state of the File Attachment component to “New”. This will allow users to delete files before they submit the case.
Use a Transition: Create a transition that changes the state of the File Attachment component to “Submitted” when the case is submitted. This will permanently prevent the file from being deleted.
You can also use OOTB visibility rules to further restrict the visibility of the delete option based on the case’s state or other factors.
If you need additional control over file deletion, consider using custom Java code in a Post-Save activity.