It is always a good idea to check for a file if exists before trying to delete it. So the code below will check for that and then will attempt to delete the file if found. The delete is performed using the build-in peoplecode function DeleteAttachment.
The code below also checks for the returned code by the function to verify whether the file has been deleted or not.
&retcode = DeleteAttachment(URL.BKFTP, ATTACHSYSFILENAME);
If (&retcode = %Attachment_Success) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment succeeded”);
UnHide(ATTACHADD);
Hide(ATTACHVIEW);
Hide(ATTACHDELETE);
ATTACHUSERFILE = “”;
ATTACHSYSFILENAME = “”;
End-If;
If (&retcode = %Attachment_Failed) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment failed”);
End-If;
If (&retcode = %Attachment_Cancelled) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment cancelled”);
End-If;
If (&retcode = %Attachment_FileTransferFailed) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment failed: File Transfer did not succeed”);
End-If;
/* following error message only in PeopleSoft Pure Internet Architecture */
If (&retcode = %Attachment_NoDiskSpaceAppServ) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment failed: No disk space on the app server”);
End-If;
/* following error message only in PeopleSoft Pure Internet Architecture */
If (&retcode = %Attachment_NoDiskSpaceWebServ) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment failed: No disk space on the web server”);
End-If;
If (&retcode = %Attachment_FileExceedsMaxSize) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment failed: File exceeds the max size”);
End-If;
If (&retcode = %Attachment_DestSystNotFound) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment failed: Cannot locate destination system for ftp”);
End-If;
If (&retcode = %Attachment_DestSysFailedLogin) Then
MessageBox(0, “File Attachment Status”, 0, 0, “DeleteAttachment failed: Unable to login into destination system for ftp”);
End-If;
Title | Under | Posted on |
---|---|---|
Component interface Error: no rows exist for the specified keys | PeopleSoft Technical | 03/15/2019 - 3:54am |
ADD 24 months starting from current month.(peoplesoft) | PeopleSoft Functional | 07/29/2018 - 8:44pm |
TRC values dropdown | PeopleSoft Technical | 04/04/2018 - 12:54am |
how to find missing sequence in GRID and print the mising sequence number while saving through peoplecode | PeopleSoft Technical | 09/11/2017 - 4:49am |
Recent comments
2 years 29 weeks ago
2 years 34 weeks ago
2 years 34 weeks ago
2 years 36 weeks ago
2 years 36 weeks ago
2 years 37 weeks ago
2 years 39 weeks ago
2 years 40 weeks ago
2 years 43 weeks ago
2 years 49 weeks ago