• ahammad sk
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
Hi,

In Custom Visualforce Delete page for multiple records, when click on Delete link that recordID is not passing to controller. 

For Single record Delete link is working , here recordID is passing to controller(passing recordid through url).

But for Multiple records when click on Delete link the recordid is not passing to controller. 

please help on the issue.

Visualforce page:
<apex:page standardController="contact" extensions="deletemultiplecont" recordSetVar="contacts" >
    <apex:form >
          <apex:pageblock >
         
           <table class="list " border="0" cellpadding="0" cellspacing="0">
           <tr class="headerRow" >
              
              <th class="headerRow"> Action </th>
              <th class="headerRow"> Name </th>
              <th class="headerRow"> MailingCity </th>
              <th class="headerRow"> Phone </th>
           </tr>
          <th> <apex:repeat value="{!contacts}" var="cont">
           <tr class="dataRow">
               
                <td class="dataCell"> <apex:commandlink value="delete" action="{!delmultplerec}"> 
                   <apex:param value="{!cont.id}" assignTo="{!asgn}"/> 
                 </apex:commandLink> </td>
               
              <td class="dataCell"> <apex:outputText value="{!cont.Name}"/> </td>
              <td class="dataCell"> <apex:outputText value="{!cont.MailingCity}"/> </td>
              <td class="dataCell"> <apex:outputText value="{!cont.phone}"/> </td>  
             
           </tr>
           </apex:repeat> </th>
           
        </table>
                 
      </apex:pageblock>
    </apex:form>

</apex:page>

Apex:

Public with sharing class deletemultiplecont
{
  public string Name{set;get;}
  public string Phone{get;set;}
  public string MailingCity{get;set;}
  public string asgn{get;set;}
  public contact cdel = new contact();
 
 public deletemultiplecont(apexpages.standardsetcontroller setcon)
  {
  
  }
  
  Public pagereference delmultplerec()
  {
      
        system.debug('hidden val is..!!' +asgn);
        try
            {
            
            cdel = [select id from contact where id =: asgn];
            system.debug('delete rec is..!!' +cdel);
            delete cdel;            
            return NULL;
            }
             catch(exception e)
             {
                System.debug('The following exception has occurred: ' + e.getMessage());
                return NULL;
             } 
  }
}
Hi,
 
In visualforce edit page "Edit" and "Delete" links are not working.

<apex:page standardController="contact" recordSetVar="contacts">
<apex:pageBlock title="Contacts" mode="Edit">
   <apex:form >
      <apex:pageBlockTable value="{!Contacts}" var="contact" > 
      
      <apex:column >
      <apex:facet name="header">action</apex:facet>
      <apex:commandLink value="Edit" action="{!edit}" />
      </apex:column> 
       
       <apex:column >
       <apex:facet name="header">action</apex:facet>
       <apex:commandLink value="Delete" action="{!delete}" />
       </apex:column> 
     
      <apex:column value="{!contact.Name}"/> 
      <apex:column value="{!contact.MailingCity}"/> 
      <apex:column value="{!contact.Phone}"/>
      </apex:pageBlockTable>
   </apex:form>
</apex:pageBlock>
</apex:page>
Hi,

How to send "Mass Email" using Visualforce Email Template. The Template wil have images, Screenshots and attachments.
 
Hi,

In Custom Visualforce Delete page for multiple records, when click on Delete link that recordID is not passing to controller. 

For Single record Delete link is working , here recordID is passing to controller(passing recordid through url).

But for Multiple records when click on Delete link the recordid is not passing to controller. 

please help on the issue.

Visualforce page:
<apex:page standardController="contact" extensions="deletemultiplecont" recordSetVar="contacts" >
    <apex:form >
          <apex:pageblock >
         
           <table class="list " border="0" cellpadding="0" cellspacing="0">
           <tr class="headerRow" >
              
              <th class="headerRow"> Action </th>
              <th class="headerRow"> Name </th>
              <th class="headerRow"> MailingCity </th>
              <th class="headerRow"> Phone </th>
           </tr>
          <th> <apex:repeat value="{!contacts}" var="cont">
           <tr class="dataRow">
               
                <td class="dataCell"> <apex:commandlink value="delete" action="{!delmultplerec}"> 
                   <apex:param value="{!cont.id}" assignTo="{!asgn}"/> 
                 </apex:commandLink> </td>
               
              <td class="dataCell"> <apex:outputText value="{!cont.Name}"/> </td>
              <td class="dataCell"> <apex:outputText value="{!cont.MailingCity}"/> </td>
              <td class="dataCell"> <apex:outputText value="{!cont.phone}"/> </td>  
             
           </tr>
           </apex:repeat> </th>
           
        </table>
                 
      </apex:pageblock>
    </apex:form>

</apex:page>

Apex:

Public with sharing class deletemultiplecont
{
  public string Name{set;get;}
  public string Phone{get;set;}
  public string MailingCity{get;set;}
  public string asgn{get;set;}
  public contact cdel = new contact();
 
 public deletemultiplecont(apexpages.standardsetcontroller setcon)
  {
  
  }
  
  Public pagereference delmultplerec()
  {
      
        system.debug('hidden val is..!!' +asgn);
        try
            {
            
            cdel = [select id from contact where id =: asgn];
            system.debug('delete rec is..!!' +cdel);
            delete cdel;            
            return NULL;
            }
             catch(exception e)
             {
                System.debug('The following exception has occurred: ' + e.getMessage());
                return NULL;
             } 
  }
}
Hi,
 
In visualforce edit page "Edit" and "Delete" links are not working.

<apex:page standardController="contact" recordSetVar="contacts">
<apex:pageBlock title="Contacts" mode="Edit">
   <apex:form >
      <apex:pageBlockTable value="{!Contacts}" var="contact" > 
      
      <apex:column >
      <apex:facet name="header">action</apex:facet>
      <apex:commandLink value="Edit" action="{!edit}" />
      </apex:column> 
       
       <apex:column >
       <apex:facet name="header">action</apex:facet>
       <apex:commandLink value="Delete" action="{!delete}" />
       </apex:column> 
     
      <apex:column value="{!contact.Name}"/> 
      <apex:column value="{!contact.MailingCity}"/> 
      <apex:column value="{!contact.Phone}"/>
      </apex:pageBlockTable>
   </apex:form>
</apex:pageBlock>
</apex:page>