• Amit Shingavi
  • NEWBIE
  • 45 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi all,

I am showing list of attachments against a record in the visualforce page, also showing a DELETE link  before each attachment. Now i want to delete the particular attachment when clicking on DELETE button. can someone help me out.

<apex:column >
     <apex:facet name="header">Attachment</apex:facet>
           <table border = '0' cellspacing="0" cellpadding="0">
              <tr><td><b><center><apex:outputLink value="/apex/AttachmentUpload?id={!card.time.id}" rendered="{!!(card.time.id ==                                                                                                                null)}">Upload</apex:outputLink></center></b><br/></td>
                        <td><apex:repeat var="attach" value="{!card.time.Attachments}">
                            <apex:outputLink value="/servlet/servlet.FileDownload?file={!attach.id}" target="_blank">
                                {!attach.Name}
                            </apex:outputLink>&nbsp;&nbsp;&nbsp;<b><a href="javascript:if (window.confirm('Are you sure?')) DeleteFile('{!attach.Id}');" style="font-weight:bold">Del</a></b><br/>
                        </apex:repeat></td></tr></table>
                </apex:column>

 Thanks,
Uday
  • December 26, 2013
  • Like
  • 0
Hi all,

I am showing list of attachments against a record in the visualforce page, also showing a DELETE link  before each attachment. Now i want to delete the particular attachment when clicking on DELETE button. can someone help me out.

<apex:column >
     <apex:facet name="header">Attachment</apex:facet>
           <table border = '0' cellspacing="0" cellpadding="0">
              <tr><td><b><center><apex:outputLink value="/apex/AttachmentUpload?id={!card.time.id}" rendered="{!!(card.time.id ==                                                                                                                null)}">Upload</apex:outputLink></center></b><br/></td>
                        <td><apex:repeat var="attach" value="{!card.time.Attachments}">
                            <apex:outputLink value="/servlet/servlet.FileDownload?file={!attach.id}" target="_blank">
                                {!attach.Name}
                            </apex:outputLink>&nbsp;&nbsp;&nbsp;<b><a href="javascript:if (window.confirm('Are you sure?')) DeleteFile('{!attach.Id}');" style="font-weight:bold">Del</a></b><br/>
                        </apex:repeat></td></tr></table>
                </apex:column>

 Thanks,
Uday
  • December 26, 2013
  • Like
  • 0