• Padmanabhan Kamuni
  • NEWBIE
  • 74 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 16
    Replies
Hey Folks,
I have a button in Community & I need some custom button action to be performed(not standard action).
Any help is appreciated.
For reference- https://paddycomm-developer-edition.ap5.force.com/forums/s/
more details- when a user click the Download button some custom action should be performed.currently new account is created (which I don't want).
Kindly help me on this.
Hey Folks,

I have a community (same like developer forum), where any users can get answers based on the query in my community. But now everytime my community is asking for login(which i don't want). Can we skip the login process ? & get the answers based on the query. All I wanted is same like Salesforce Developer forum.
Kindly help me.
Here is vf page
<apex:page controller="EmailSending">
    <apex:form id="ww">    	
        <apex:pageBlock >
            <apex:pageBlockSection collapsible="false" columns="3" >
            	<apex:pageBlockTable value="{!cts}" var="c">
                	<apex:column headerValue="Name">
                        <apex:commandLink value="{!c.name}" action="{!gettoActivate}" reRender="ww">
                        <apex:param value="{!c.id}" name="varId"/>
                        </apex:commandLink>
                    </apex:column>
                    <apex:column value="{!c.id}" />
                    <apex:column value="{!c.Email}" />
                </apex:pageBlockTable>
           </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Send E-mail" action="{!sendEmail}" />
                <apex:commandButton value="Send VF Template" action="{!sendVFTemp}"/>
                <apex:commandButton value="Send HTML" action="{!sendHTMLTemp}" /> 
                <apex:commandButton action="{!clearit}" value="Reset" reRender="aa" />
            </apex:pageBlockButtons>            
            <apex:pageBlockSection columns="3" id="aa" >            
                <apex:inputText value="{!emailAddress}" label="Enter E-mail Address * :" required="true" />                   
                <apex:inputText value="{!subject}" label="Subject :"/>                  
                <apex:inputTextarea value="{!body}" label="Body :"/>         
            </apex:pageBlockSection>
        </apex:pageBlock>
           
    </apex:form>
</apex:page>
And controller 
public class EmailSending {
    public string emailAddress {get;set;}
    public string subject {get;set;}
    public string body {get;set;}
    
    public list<string> forConversition {get;set;}
    public list<contact> cts	{get;set;}
    public String rec {get;set;}
    
    public Task35(){
        forConversition = new List<string>();
      //  cts	=	new list<contact>();
        cts	=	[SELECT Name,ID,Email FROM Contact limit 10];
       // gg= new Group__c ();
       
    }
    
    public void sendEmail(){
      // subject	=	'the address is'+a;
       //body		=	'this is a test body that is being sent to '+a;
        //system.debug(a);
         Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();       	
       		forConversition.add(emailAddress);               
        		email.setToAddresses(forConversition);
           // System.debug('email'+emailAddress);
        	email.setSubject(subject);
        	email.setPlainTextBody( body );
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});  
       
    }
    public void gettoActivate(){
        system.debug('how are you guys');
        rec	=	ApexPages.CurrentPage().getParameters().get( 'varId' );
         system.debug('recid is'+rec);
       // return new pagereference(rec);
    }
    public void sendHTMLTemp(){
        //system.debug(varID);
        rec	=	ApexPages.CurrentPage().getParameters().get( 'varId' );
        system.debug(rec);
      //  cts	=	[SELECT ID from Contact where ID=:rec];
        EmailTemplate et = [SELECT Id FROM EmailTemplate where name =:'HTML temp1'];
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();       	
       		forConversition.add(emailAddress);               
        		email.setToAddresses(forConversition);
        		email.setTemplateId(et.Id);
        	email.setTargetObjectId(rec);
           // System.debug('email'+emailAddress);
        	//email.setSubject(subject);
        	//email.setPlainTextBody( body );
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    }
    public void sendVFTemp(){
         rec	=	ApexPages.CurrentPage().getParameters().get( 'varId' );
        system.debug(rec);
        EmailTemplate et = [SELECT Id FROM EmailTemplate where name =:'VF page e-mail Template'];
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();       	
       		forConversition.add(emailAddress);               
        		email.setToAddresses(forConversition);
        		email.setTemplateId(et.Id);
        	email.setTargetObjectId(rec);
           // System.debug('email'+emailAddress);
        	//email.setSubject(subject);
        	//email.setPlainTextBody( body );
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    }
    
    public void clearit(){
        emailAddress = Null;
        subject= Null;
        body= Null;
    }
}


 
public class Task0 {   
    public List<wrapGroup> acc{get;set;}
    public List<Group__c> abc{get;set;}
    public List<Group__c> abc1{get;set;}
    public string Recid{get;set;}
    
    public Task0(){    
        {
            acc=new List<wrapGroup>();
            abc1 = new List<Group__c>();
              List<Group__c> gcc=[SELECT name,id,Course_Name__c,Degree__c,Mobile__c FROM Group__c];
              For(Group__c g : gcc  ){
              acc.add(new wrapGroup(g));
              }
          }
          system.debug(acc);
  }   
    public pageReference del(){
      // abc=new List<Group__c>();
         for(wrapGroup a : acc){
        if(a.checkbox1 == true){            
           abc1.add(a.gname);           
           //string recid = ApexPages.CurrentPage().getParameters().get('a.id');            
            //string recid;
            system.debug(' abc1'+abc1);
            //abc=[select id FROM Group__c WHERE id= :Recid];
            //system.debug('List'+abc);                      
            }
        }
          delete abc1;          
        return null;
    }   
    public class wrapGroup{
        public Group__c gname{get;set;}
            public boolean checkbox1{get;set;}       
    public wrapGroup(Group__c g){
        gname=g;
        checkbox1=false;
    }     
    }
 }


 
<apex:page controller="Task0" >
    <apex:form >
       <script>
         function enableDisable(cb)
    {
      $("input:checkbox[id*=looped]").removeAttr('checked');
      $(cb).attr('checked', 'checked');
    }
		</script>
        <apex:pageBlock >
            <!--<apex:commandButton value="Delete" action="{!Del}" />-->
            <apex:pageBlockTable value="{!acc}" var="a" >
                <apex:column value="{!a.gname.name}"/>
                <apex:column value="{!a.gname.Mobile__c}"/>
                <apex:column value="{!a.gname.Course_Name__c}"/>
               <!-- <apex:column >
                    <apex:outputField value="{!a.gname.Id}">
                <apex:param value="{!a.gname.id}" assignTo="{!Recid}" />  
                    </apex:outputField>
                </apex:column>-->
                <apex:column title="Select to Delete" >
                   
                 <apex:inputCheckbox id="looped" value="{!a.checkbox1}" onclick="enableDisable(this)" />                   
                        
                </apex:column>
               
            </apex:pageBlockTable>
         </apex:pageBlock>
     </apex:form>   
</apex:page>

 
Hello,

Please find the code below and guide me.
public class Task17 {
    public Map<String, schema.SObjectType> allObjects {get;set;}
    public List<SelectOption>	objNames	{get; set;}
    public String objName {get; set;}
    public String selectedName	{get; set;}
	
    public Task17(){
        list<selectoption> objNames = new List<selectoption>();
        allObjects = schema.getGlobalDescribe();
        list<string> allNames = new list<string>(allObjects.keySet());
        //allNames.sort();
        system.debug('line 19'+allNames);
            for( String key1 : allNames){
                objNames.add(new SelectOption(key1,key1));
            }
        system.debug('Line22'+objNames);
        
    }    
}

VF page is below.
<apex:page controller="Task17" >
    <apex:form>
    	<apex:pageBlock>            
        	Please Select the obj
            <apex:selectList value="{!selectedName}">
            	<apex:selectOptions value="{!objNames}"/>
            </apex:selectList>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Pick list is not displaying.  Help..
 
Create a new VisualForce Page, such that the page enables creation of a new Lead
when inserted, the details should be displayed in a new page, that means the record detail page should open in a new tab/page
the page should be reloaded with the detail page.
public class Task09 {   
    public List<Wrappergroup> acc{get;set;}
    public Task09(){    
    if(acc==null){
        acc=new List<Wrappergroup>();
          List<Group__c> gcc=[SELECT name,Course_Name__c,Degree__c,Mobile__c FROM Group__c];
          For(Group gname:gcc){
          acc.add(new Wrappergroup(g));
          }
    }
  }   
       
    public class Wrappergroup{
        public Group gname;
        public boolean checkbox;
        
    }
    public Wrappergroup(Group g){
        gname=g;
        checkbox=false;
         
    }
 }

 
I want to create a Flow, In which the first page would be a picklist.
And second page would be a output page were it should display the records containing the picklist selected.

Help me !!
Controller class.

 public class SetVFPage {
   public Set<Group__c>acc { get; set; }
     public string keyword{get;set;}
     List<Group__c > accList{get;set;}
      Set<Group__c > accSET = new Set<Group__c >();                
     public pagereference Search(){    
       accList =[SELECT Name, id,Course_Name__c FROM Group__c where Name Like: '%'+keyword+'%'];
       for(Group_c gp : accList){
       gp.name;
       }         
           return null;
     }
}

VF Page
<apex:page controller="SetVFPage ">
    <apex:form >
        <apex:pageBlock >
            <!--<apex:inputField value="{!keyword}"/>-->
            <apex:commandButton value="Search" action="{!Search}" />
            <apex:pageBlockTable value="{!acc}" var="s">
                <apex:column value="{!s.name}"/>
                <apex:column value="{!s.Course_Name__c} "/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Error: Task08 Compile Error: Invalid type: Group_c at line 12 column 12
Request your comments for solution.
Thanks
public class Task08 {
     public string keyword{get;set;}
     Set<Account> sette=new Set<Account>(); 
      public Task08(){
      
      sette=[SELECT Name FROM Account ];
      }
     public pagereference Search(){
    
        //sette=[SELECT Name, id,Course_Name__c FROM Group__c ];
         return null;
     }
}
Now I want to attract different users to get signup & use the service. How can i do? without giving access to every profile or user everytime? Kindly help me in this.
Hey Folks,
I have a button in Community & I need some custom button action to be performed(not standard action).
Any help is appreciated.
For reference- https://paddycomm-developer-edition.ap5.force.com/forums/s/
more details- when a user click the Download button some custom action should be performed.currently new account is created (which I don't want).
Kindly help me on this.
Hey Folks,
I have a button in Community & I need some custom button action to be performed(not standard action).
Any help is appreciated.
For reference- https://paddycomm-developer-edition.ap5.force.com/forums/s/
more details- when a user click the Download button some custom action should be performed.currently new account is created (which I don't want).
Kindly help me on this.
class a{
    class b{
        int a;
    }
    class c{
        string b;
    }
    
    static list<class> method(){
        if(condition){
            b obj=new b;
            return obj;
        }
        else{
            c obj=new c;
            return obj;
        }
    }
}

 
Here is vf page
<apex:page controller="EmailSending">
    <apex:form id="ww">    	
        <apex:pageBlock >
            <apex:pageBlockSection collapsible="false" columns="3" >
            	<apex:pageBlockTable value="{!cts}" var="c">
                	<apex:column headerValue="Name">
                        <apex:commandLink value="{!c.name}" action="{!gettoActivate}" reRender="ww">
                        <apex:param value="{!c.id}" name="varId"/>
                        </apex:commandLink>
                    </apex:column>
                    <apex:column value="{!c.id}" />
                    <apex:column value="{!c.Email}" />
                </apex:pageBlockTable>
           </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Send E-mail" action="{!sendEmail}" />
                <apex:commandButton value="Send VF Template" action="{!sendVFTemp}"/>
                <apex:commandButton value="Send HTML" action="{!sendHTMLTemp}" /> 
                <apex:commandButton action="{!clearit}" value="Reset" reRender="aa" />
            </apex:pageBlockButtons>            
            <apex:pageBlockSection columns="3" id="aa" >            
                <apex:inputText value="{!emailAddress}" label="Enter E-mail Address * :" required="true" />                   
                <apex:inputText value="{!subject}" label="Subject :"/>                  
                <apex:inputTextarea value="{!body}" label="Body :"/>         
            </apex:pageBlockSection>
        </apex:pageBlock>
           
    </apex:form>
</apex:page>
And controller 
public class EmailSending {
    public string emailAddress {get;set;}
    public string subject {get;set;}
    public string body {get;set;}
    
    public list<string> forConversition {get;set;}
    public list<contact> cts	{get;set;}
    public String rec {get;set;}
    
    public Task35(){
        forConversition = new List<string>();
      //  cts	=	new list<contact>();
        cts	=	[SELECT Name,ID,Email FROM Contact limit 10];
       // gg= new Group__c ();
       
    }
    
    public void sendEmail(){
      // subject	=	'the address is'+a;
       //body		=	'this is a test body that is being sent to '+a;
        //system.debug(a);
         Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();       	
       		forConversition.add(emailAddress);               
        		email.setToAddresses(forConversition);
           // System.debug('email'+emailAddress);
        	email.setSubject(subject);
        	email.setPlainTextBody( body );
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});  
       
    }
    public void gettoActivate(){
        system.debug('how are you guys');
        rec	=	ApexPages.CurrentPage().getParameters().get( 'varId' );
         system.debug('recid is'+rec);
       // return new pagereference(rec);
    }
    public void sendHTMLTemp(){
        //system.debug(varID);
        rec	=	ApexPages.CurrentPage().getParameters().get( 'varId' );
        system.debug(rec);
      //  cts	=	[SELECT ID from Contact where ID=:rec];
        EmailTemplate et = [SELECT Id FROM EmailTemplate where name =:'HTML temp1'];
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();       	
       		forConversition.add(emailAddress);               
        		email.setToAddresses(forConversition);
        		email.setTemplateId(et.Id);
        	email.setTargetObjectId(rec);
           // System.debug('email'+emailAddress);
        	//email.setSubject(subject);
        	//email.setPlainTextBody( body );
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    }
    public void sendVFTemp(){
         rec	=	ApexPages.CurrentPage().getParameters().get( 'varId' );
        system.debug(rec);
        EmailTemplate et = [SELECT Id FROM EmailTemplate where name =:'VF page e-mail Template'];
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();       	
       		forConversition.add(emailAddress);               
        		email.setToAddresses(forConversition);
        		email.setTemplateId(et.Id);
        	email.setTargetObjectId(rec);
           // System.debug('email'+emailAddress);
        	//email.setSubject(subject);
        	//email.setPlainTextBody( body );
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    }
    
    public void clearit(){
        emailAddress = Null;
        subject= Null;
        body= Null;
    }
}


 
public class Task0 {   
    public List<wrapGroup> acc{get;set;}
    public List<Group__c> abc{get;set;}
    public List<Group__c> abc1{get;set;}
    public string Recid{get;set;}
    
    public Task0(){    
        {
            acc=new List<wrapGroup>();
            abc1 = new List<Group__c>();
              List<Group__c> gcc=[SELECT name,id,Course_Name__c,Degree__c,Mobile__c FROM Group__c];
              For(Group__c g : gcc  ){
              acc.add(new wrapGroup(g));
              }
          }
          system.debug(acc);
  }   
    public pageReference del(){
      // abc=new List<Group__c>();
         for(wrapGroup a : acc){
        if(a.checkbox1 == true){            
           abc1.add(a.gname);           
           //string recid = ApexPages.CurrentPage().getParameters().get('a.id');            
            //string recid;
            system.debug(' abc1'+abc1);
            //abc=[select id FROM Group__c WHERE id= :Recid];
            //system.debug('List'+abc);                      
            }
        }
          delete abc1;          
        return null;
    }   
    public class wrapGroup{
        public Group__c gname{get;set;}
            public boolean checkbox1{get;set;}       
    public wrapGroup(Group__c g){
        gname=g;
        checkbox1=false;
    }     
    }
 }


 
<apex:page controller="Task0" >
    <apex:form >
       <script>
         function enableDisable(cb)
    {
      $("input:checkbox[id*=looped]").removeAttr('checked');
      $(cb).attr('checked', 'checked');
    }
		</script>
        <apex:pageBlock >
            <!--<apex:commandButton value="Delete" action="{!Del}" />-->
            <apex:pageBlockTable value="{!acc}" var="a" >
                <apex:column value="{!a.gname.name}"/>
                <apex:column value="{!a.gname.Mobile__c}"/>
                <apex:column value="{!a.gname.Course_Name__c}"/>
               <!-- <apex:column >
                    <apex:outputField value="{!a.gname.Id}">
                <apex:param value="{!a.gname.id}" assignTo="{!Recid}" />  
                    </apex:outputField>
                </apex:column>-->
                <apex:column title="Select to Delete" >
                   
                 <apex:inputCheckbox id="looped" value="{!a.checkbox1}" onclick="enableDisable(this)" />                   
                        
                </apex:column>
               
            </apex:pageBlockTable>
         </apex:pageBlock>
     </apex:form>   
</apex:page>

 
Hello,

Please find the code below and guide me.
public class Task17 {
    public Map<String, schema.SObjectType> allObjects {get;set;}
    public List<SelectOption>	objNames	{get; set;}
    public String objName {get; set;}
    public String selectedName	{get; set;}
	
    public Task17(){
        list<selectoption> objNames = new List<selectoption>();
        allObjects = schema.getGlobalDescribe();
        list<string> allNames = new list<string>(allObjects.keySet());
        //allNames.sort();
        system.debug('line 19'+allNames);
            for( String key1 : allNames){
                objNames.add(new SelectOption(key1,key1));
            }
        system.debug('Line22'+objNames);
        
    }    
}

VF page is below.
<apex:page controller="Task17" >
    <apex:form>
    	<apex:pageBlock>            
        	Please Select the obj
            <apex:selectList value="{!selectedName}">
            	<apex:selectOptions value="{!objNames}"/>
            </apex:selectList>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Pick list is not displaying.  Help..
 
Create a new VisualForce Page, such that the page enables creation of a new Lead
when inserted, the details should be displayed in a new page, that means the record detail page should open in a new tab/page
the page should be reloaded with the detail page.
Controller class.

 public class SetVFPage {
   public Set<Group__c>acc { get; set; }
     public string keyword{get;set;}
     List<Group__c > accList{get;set;}
      Set<Group__c > accSET = new Set<Group__c >();                
     public pagereference Search(){    
       accList =[SELECT Name, id,Course_Name__c FROM Group__c where Name Like: '%'+keyword+'%'];
       for(Group_c gp : accList){
       gp.name;
       }         
           return null;
     }
}

VF Page
<apex:page controller="SetVFPage ">
    <apex:form >
        <apex:pageBlock >
            <!--<apex:inputField value="{!keyword}"/>-->
            <apex:commandButton value="Search" action="{!Search}" />
            <apex:pageBlockTable value="{!acc}" var="s">
                <apex:column value="{!s.name}"/>
                <apex:column value="{!s.Course_Name__c} "/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Error: Task08 Compile Error: Invalid type: Group_c at line 12 column 12
Request your comments for solution.
Thanks
public class Task08 {
     public string keyword{get;set;}
     Set<Account> sette=new Set<Account>(); 
      public Task08(){
      
      sette=[SELECT Name FROM Account ];
      }
     public pagereference Search(){
    
        //sette=[SELECT Name, id,Course_Name__c FROM Group__c ];
         return null;
     }
}
Now I want to attract different users to get signup & use the service. How can i do? without giving access to every profile or user everytime? Kindly help me in this.