• chandu kumar
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 7
    Replies
I created a Vf page where it shows Account related object record namea with checkboxes to select and contact as picklist.
I want tosend email the selected records list to selected contact. How to add the selected contact id and selected list of records in EMail method. My code is below
 
public with sharing class Nex_Send_Email{
 private ApexPages.StandardController standardController;
 
    Private Id accID;
    public List<SysWrapper> listSysWrapper {get; set;}
    public List<NEX_System__c> selectedSystems{get;set;}
     //private final List<Id> contactids ;

  public ID contactID {get; set;}
   public List<SelectOption> contactList{get;set;}
    public string selectedContact { get; set; }
      public string selectedReseller {get;set;}
    
    
    public Nex_Send_Email(ApexPages.StandardController standardController)
    {
     accID=  ApexPages.currentPage().getParameters().get('acId');
       system.debug('accID::' +accID);
            listSysWrapper = new List<SysWrapper>();
            searchRecord();
            
       List<Contact> oContact = [select id, Name, email from Contact where AccountId=:accID and Contact_Status__c = 'Active' and email !=null];

        contactList = new List<SelectOption>();
        contactList.add(new SelectOption('','--None--'));
        for(Contact ct: oContact)
        {
            contactList.add(new SelectOption(ct.id,ct.Name+' - '+ct.email));
            contactID = ct.Id;
            system.debug('contactID ::' +contactID );       
            
            
    }
    }
    
    public void searchRecord()
    {
        listSysWrapper .clear();
            for(NEX_System__c a: [select Id, Name from NEX_System__c where Nex_Account__c=:accID AND NEX_System_State__c='Active' limit 10]) 
            {
                listSysWrapper .add(new SysWrapper(a));
            }
            system.debug('listSysWrapper ::' +listSysWrapper); 
    }

    public void processSelected() 
    {
        selectedSystems= new List<NEX_System__c>();
        selectedSystems.clear();
        for(SysWrapper wrapAccountObj : listSysWrapper) 
        {
            if(wrapAccountObj.selected == true) 
            {
                selectedSystems.add(wrapAccountObj.acc);
                 system.debug('selectedSystems::' +selectedSystems); 
            }
        }
    }

  
    


    // This is our wrapper/container class. 
    public class SysWrapper
    {
        public NEX_System__c acc {get; set;}
        public Boolean selected {get; set;}
        public SysWrapper(NEX_System__c  a) 
        {
            acc = a;
            selected = false;
        }
    }
    
     public void contactsrefresh()
    {
        system.debug('selected reseller:' +selectedReseller);
        if (selectedReseller!=null)
        {
            contactList.clear();
            List<Contact> resellercontacts = [select id, Name, email from Contact where (AccountId = :accID or AccountId = :selectedReseller) and Contact_Status__c = 'Active' and email !=null];
            contactList.add(new SelectOption('','--None--'));
            for (Contact rc :resellercontacts)
            {
                if(rc.accountid == accID)
                {
                    contactList.add(new SelectOption(rc.id,rc.Name+' - '+rc.email));
                }
            }
            for (Contact rc :resellercontacts)
            {
                if(rc.accountid != accID)
                {
                    contactList.add(new SelectOption(rc.id,rc.Name+' - '+rc.email));
                }
            }
        }
        }  
           

}

Please help to add email method and add contact as to addressa nd add list of records as subject
I have Account object and custom object System__c I want a custom button on account and when i click on it,pop up will come and it should display all active systems with select checkbox. once i select multiple records, i should able to send the records to select contact. Please help on this. I think it could be achieved by wrapper class.
i want to write a trigger when case created by email to case from particular account  and moved to draft using trigger. then i want to update account and contact lookup fields as blank in same trigger. Please help on this.

I am trying to make account and contact lookup fields for a particular account. i am able to update the status field and send email to respective contact as it is spam. i couldn't able to update the account and contact fields are blank.there is no filters on fields. i tried code provided below
Trigger SpamCatch on Case(before Insert)
{  

    for(Case newCase: Trigger.New)
    {   
        EmailTemplate template=[SELECT HtmlValue,Body FROM EmailTemplate WHERE Name='SpamCatchEmail'];


        if(newCase.Origin=='Email' && newCase.Subject.contains('Auto Response'))
        {
            newCase.addError('This is auto response mail. Aborting case creation.');
        }

        Integer NexComm = 0;
        String k;

        if(newCase.Origin =='Email' && newCase.SuppliedEmail !=null  )
        {      
            for(Contact cObj: [Select id, Name, email, Accountid from contact where email = :newCase.SuppliedEmail and Accountid in (select id from account where name =: System.Label.NexComm)])
            {
                NexComm = 1;
                k=cobj.Name;
            }

            for(Contact cObj: [Select id,Name, email, Accountid from contact where email = :newCase.SuppliedEmail and Accountid in (select id from account where name !=: System.Label.NexComm)])
            {
                NexComm = 0;
                k=cobj.Name;
            }


            if(newCase.Origin =='Email' && newCase.SuppliedEmail !=null  )
            { 
                String hbody='';
                String plainTxtBody='';
                hbody=template.HtmlValue;
                hbody=hbody.replace('{!Contact.Name}',k);
                plainTxtBody=template.Body;

                List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                List<String> sendTo = new List<String>();
                sendTo.add(newCase.SuppliedEmail );
                System.debug(newCase.SuppliedEmail);

                mail.setToAddresses(sendTo);

                OrgWideEmailAddress[] owea = [select Id,DisplayName,Address from OrgWideEmailAddress where Address = 'portal.support@nexenta.com' limit 1];
                //mail.setReplyTo('portal.support@nexenta.com');

                List<String> ccTo = new List<String>();
                ccTo.add('satheesh.thondamanti@nexenta.com');
                mail.setCcAddresses(ccTo);
                mail.setTemplateID(template.Id);//This is the template you are setting
                mail.setSubject(' Email to Case Response');
                //String body = 'Dear ' + Contact.FirstName + Contact.LastName + ', ';
                //body += 'Thank you for your email. Your support request cannot be processed at the moment. Support is available only for Nexenta customers who has valid support contract.For any queries on your community edition, please go to https://community.nexenta.com and post your query. If you have valid support contract, please get in touch with your Nexenta sales team with purchase details to get access to Nexenta support portal.';
                mail.setOrgWideEmailAddressId(owea.get(0).Id);
                mail.setHtmlBody(hbody);
                // mail.setPlainTextBody(plainTxtBody);

                // mail.setTreatTargetObjectAsRecipient(true);
                mails.add(mail);
                System.debug(mail);
                Messaging.sendEmail(mails);
                //Messaging.SendEmailResult[] results = Messaging.sendEmail(messages);
            } 
            if ( NexComm == 1 )
            {
                newCase.Status='DCL'; 
                newCase.AccountId='';
                newCase.ContactId='';
                system.debug('Status:'+newCase.Status);
                System.debug(NexComm  + '3' + newCase.SuppliedEmail);  

            }
        }
    }
}

 
I created an email alert in a trigger.it's not displaying images(custom html).how could i send email alert with HTML template with letter head.I dont think it doesn't support.is it? below is my code.
 
EmailTemplate template=[SELECT HtmlValue,Body FROM EmailTemplate WHERE Name='SpamCatchTest1'];     //custom html )(without letterhead)template

if(newCase.Origin =='Email' && newCase.SuppliedEmail !=null ) { String hbody=''; String 

plainTxtBody=''; hbody=template.HtmlValue; hbody=hbody.replace('{!Contact.Name}',k); plainTxtBody=template.Body;
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>(); Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); List<String> sendTo = new List<String>(); 

sendTo.add(newCase.SuppliedEmail ); System.debug(newCase.SuppliedEmail); mail.setToAddresses(sendTo); OrgWideEmailAddress[] owea = [select Id from 

OrgWideEmailAddress where Address = 'portal.support@nexenta.com']; //mail.setReplyTo('portal.support@xxx.com'); 
List<String> ccTo = new List<String>(); ccTo.add('satheesh.thondamanti@xxx.com'); 
mail.setCcAddresses(ccTo); 
mail.setTemplateID(template.Id);//This is the template you are setting mail.setSubject('Email to Case Response'); 
//String body = 'Dear ' + Contact.FirstName + Contact.LastName + ', ';
 //body += 'Thank you for your email. Your support request cannot be processed at the moment. Support is available only for Nexenta customers who has valid support contract.For any queries on your community edition, please go to  and post your query. If you have valid support contract, please get in touch with your Nexenta sales team with purchase details to get access to Nexenta support portal.'; mail.setOrgWideEmailAddressId(owea.get(0).Id); 
mail.setHtmlBody(hbody); 
// mail.setPlainTextBody(plainTxtBody); 
// mail.setTreatTargetObjectAsRecipient(true);
 mails.add(mail); System.debug(mail); 
Messaging.sendEmail(mails); 
//Messaging.SendEmailResult[] results = Messaging.sendEmail(messages); }
When a particular Account Contacts try to create case using email,the case should not be created and auto email should be triggered. i wrote a trigger and its avoiding creation but emails are not sending out automatically.the code is below.

Trigger SpamCatch on Case(Before Insert)
{  
  for(Case newCase: Trigger.New)
  {   
  
  if(newCase.Origin=='Email' && newCase.Subject.contains('Auto Response'))
  {
     newCase.addError('This is auto response mail. Aborting case creation.');
  }
  
  Integer Ncommunity = 0;
  
   if(newCase.Origin =='Email' && newCase.SuppliedEmail !=null  )
   {      
      for(Contact cObj: [Select id, email, Accountid from contact where email = :newCase.SuppliedEmail and Accountid in (select id from account where name =: System.Label.Ncommunity)])
      {
          Ncommunity = 1;
      }
      
      for(Contact cObj: [Select id, email, Accountid from contact where email = :newCase.SuppliedEmail and Accountid in (select id from account where name !=: System.Label.Ncommunity)])
      {
          Ncommunity = 0;
      }
          
      if ( Ncommunity == 1 )
      {
          newCase.addError('Community contacts cannot create case. Aborting case creation.');
          
          System.debugNcommunity + '3' + newCase.SuppliedEmail);
          
          List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
          Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
          List<String> sendTo = new List<String>();
          sendTo.add(newCase.SuppliedEmail );
          System.debug(newCase.SuppliedEmail);
          
          mail.setToAddresses(sendTo);
          mail.setSubject('Testing for Nex Comm');
          
          mail.setReplyTo('xxxx@xxxx.com');
         
          List<String> ccTo = new List<String>();
          ccTo.add('xxxx@xxxx.com');
          mail.setCcAddresses(ccTo);
          
          String body = 'Auto generated mail, please donot response ';
          body += 'Auto generated mail, please donot response';
          mail.setHtmlBody(body);
         // mail.setTreatTargetObjectAsRecipient(true);
          mails.add(mail);
          System.debug(mail);
          Messaging.sendEmail(mails);
          
      }   
      
   }
  
  }
}

Please help on this
1) the current quote headers are universal for each of the templates. europe requires unique headers for each of the languages/region.  Dynamically render template headers based on language/region like french ,dutch,uk english etc
Hi,

I have a scenario,that in account object there are two fields 1>status:checkbox
                                                                                       2>status range:process,final
i have wrote a trigger on on account object that when i checked the checkboxthe status range field shoud be complete otherwise incomplete. but if i try to update account records thetriggers are firing everytime. iwant to avoid it.how?
 
Hi,
I need a test code for this pagereference method ..its with for loops and if conditions..so help me to findout this.
Thanks in advance.
public PageReference Del (){
        Integer dmlrows = Limits.getLimitDMLRows();
        Integer curdmlrows = Limits.getDMLRows(); 
        Integer remainingdmlrows = dmlrows - curdmlrows;
        
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('index'));  
        
        if (newRFPProdList.get(indexVal - 1).id!=null)
            delRFPProdList.add(newRFPProdList.get(indexVal - 1));
        
        Id prodid = newRFPProdList.get(indexVal - 1).Product__c;  
        system.debug('selectedprodid'+prodid);
        try{
        delete [select ID from rfp_question__c where rfp__c = :rfpID and product__c =: prodid];
        remainingdmlrows = dmlrows - curdmlrows;
        
        newprd.remove(indexVal - 1);
        newRFPProdList.remove(indexVal - 1);
        
        if(delRFPProdList.size()>0)
            delete delRFPProdList;
        delRFPProdList.clear();
        }
        catch (Exception e) {
          String  message  = '[ PACRES ] Exception: ' + e.getMessage() + '; line: ' + e.getLineNumber() ;
            //ApexPages.addMessage(message);
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL, '[ PACRES ] Exception: ' + e.getMessage() ));
            exceptionMessages += message + '\n\n';
        }
        return null;
    }

    public PageReference AddOptInQuestions (){
        List<rfp_question__c> rqlist = new List<rfp_question__c>();
        if(UserSelectOptInQ!= null){
            if (!setOptInQ.contains(UserSelectOptInQ)){
                for(Question_Product__c c: [SELECT Question__r.Id, Question__c, Product__c, Question__r.Question_Text__c, Question__r.type__c,Question__r.Chapter__c, Question__r.Subgroup__c, Product__r.name 
                                            FROM Question_Product__c WHERE Question__r.Opt_in_question__c =:true and Question__r.Subgroup__c=:UserSelectOptInQ limit 100]){
                                                RFP_Question__c rq = new RFP_Question__c();
                                                rq.Question__c = c.Question__r.id;
                                                rq.Question_Text__c = c.Question__r.Question_Text__c;
                                                rq.RFP__c = RFPId;
                                                rq.Product__c = c.Product__c;
                                                //rq.Unique_ID__c = RFPId + '-' + c.Question__r.ID;
                                                rq.Type__c = c.Question__r.Type__c;
                                                rq.Subgroup__c = c.Question__r.Subgroup__c;
                                                rq.Chapter__c = c.Question__r.Chapter__c;
                                                rq.ProductName__c = c.Product__r.name;
                                                rq.status__C = 'Active';
                                                selectedOptInQuestions.add(rq);
                                            }
                setOptInQ.add(UserSelectOptInQ);
                OptInQ.add(UserSelectOptInQ);
            }
            if(selectedOptInQuestions.size()>0)
                upsert selectedOptInQuestions;
        }
                    Integer i;
            for(rfp_question__c ri: [select no__c  from rfp_question__c where Status__c != 'Removed' and RFP__c=:RFPId and no__c != null order by no__c desc limit 1]){
                i = Integer.valueOf(ri.no__c);
            }
            if (i == null)
                i = 0;
            List<rfp_question__c> rqlist1 = new List<rfp_question__c>();
            for(rfp_question__c rq: [select id, no__c, Question__r.Subgroup__c, Question__r.Type__c, Product__r.name from rfp_question__c 
                                     where RFP__c=:RFPId and no__c = null]){
                                         i++;
                                         rq.no__c = i;
                                         rqlist1.add(rq);
                                     }
            if(rqlist1.size()>0)
                upsert rqlist1;
        return null;
public PageReference Add (){
        boolean duplicate = false;
        if(UserSelectVAlue != null){
            Product2 addedprd = [select id,name, Description, ProductCode, Family from Product2 where name=: UserSelectVAlue];
            addedprd.Description = addedprd.name;
            for (Product2 prd: newprd){
                if(prd.id == addedprd.Id){
                    duplicate = true;
                    break;
                }   
public class newRFPController {
    public Product2 product;
    public Question__c question {get;set;}
    public Carrier_Response_Status__c carrier {get;set;}
    public Contact contact {get;set;}
    public Question_Product__c questionproduct {get;set;}
    public string UserSelectVAlue {set;get;}
    public string UserSelectOptInQ {set;get;}
    public String UserSelectFamily {get;set;}
    public string UserSelectCarrier {set;get;}     
    public boolean OptInQuestion {set;get;}
    public List<Product2> newprd {set;get;}
    public List<Contact> newcontact {set;get;}
    public List<Carrier_Response_Status__c> newcarrier {set;get;}
    private string selectedtab;
    public Set<id> productIds;
    public Id RFPId;
    public list<RFP_Product__c> newRFPProdList {set;get;}
    public list<RFP_Product__c> delRFPProdList;
    public list<Carrier_Response_Status__c> delcarrier;
    public List<CCWRow> tRecords{get;set;}
    public List<RFP_Question__c> selectedQuestions{get;set;}
    public List<RFP_Question__c> selectedOptInQuestions{get;set;}
    public List<Question_Product__c> editQuestions {get;set;}
    public String sDeveloperName;
    public String RFPname {set;get;}
    private string exceptionMessages = ''; 
    public list<String> OptInQ {get;set;}
    set<String> setOptInQ = new set<String>();
    public ID targetQuestionId {set;get;}
    private String [] m_lstVals = new String[]{};
        public void setValues (String [] lstVals) { 
            this.m_lstVals = lstVals;
            system.debug('m_lstVals1'+m_lstVals);
        } 
    public String [] getValues () { 
        system.debug('m_lstVals1'+m_lstVals);
        return m_lstVals; 
    } 
    public newRFPController(){
        this.newprd = new List<Product2>();
        this.newcarrier = new List<Carrier_Response_Status__c>();
        this.delcarrier = new List<Carrier_Response_Status__c>();
        this.carrier = new Carrier_Response_Status__c();
        this.contact = new Contact();
        this.productIds = new Set<id>();
        this.selectedTab = 'tab1';
        this.OptInQuestion = false;
        this.RFPId = ApexPages.currentPage().getParameters().get('id');
        this.newRFPProdList = new list<RFP_Product__c>();
        this.delRFPProdList = new list<RFP_Product__c>();
        this.tRecords = new List<CCWRow>();
        this.selectedQuestions = new List<RFP_Question__c>();
        this.selectedOptInQuestions = new List<RFP_Question__c>();
        this.OptInQ = new list<String>();
        //set initial page
        this.page = 1;
        pageSize = 10;
        displayPopup = false;
        for (RFP_Product__c existingprd: [select id, Product__r.id,Productname__c, Description__c, Productcode__c, ProductFamily__c from RFP_Product__c where Product__r.type__c = 'Plan level' and RFP__c=:RFPId]){
            Product2 addedprd = new Product2();
            addedprd.id = existingprd.Product__r.id;
            newprd.add(addedprd);
            productIds.add(addedprd.id);
            newRFPProdList.add(existingprd);
        }
        for(Question__c q: [select SubGroup__c from Question__c where Opt_in_question__c = true and id in (select Question__c from rfp_question__c where RFP__c=:RFPId)]){            
            if (q != null){
                setOptInQ.add(q.SubGroup__c);                
            }
        }
        OptInQ.addAll(setOptInQ);
        for (Carrier_Response_Status__c existingcar: [select id, name,Key_Contact__c, Locked__c, Status__c from Carrier_Response_Status__c where RFP__c=:RFPId ]){
            newcarrier.add(existingcar);
        }
        for (rfp__c r: [select name from rfp__c where id=: RFPId Limit 1]){
            RFPName = r.name;
        }
    }
    public PageReference Add (){
        boolean duplicate = false;
        if(UserSelectVAlue != null){
            Product2 addedprd = [select id,name, Description, ProductCode, Family from Product2 where name=: UserSelectVAlue];
            addedprd.Description = addedprd.name;
            for (Product2 prd: newprd){
                if(prd.id == addedprd.Id){
                    duplicate = true;
                    break;
                }   
            }
            if (!duplicate){
                newprd.add(addedprd);
                productIds.add(addedprd.id);
                RFP_Product__c newRFPProd = new RFP_Product__c();
                newRFPProd.Product__c = addedprd.id;
                newRFPProd.RFP__c = RFPId;
                newRFPProd.Description__c = addedprd.Description;
                newRFPProd.Productname__c = addedprd.name;
                newRFPProd.Productcode__c = addedprd.ProductCode;
                newRFPProd.ProductFamily__c = addedprd.Family;
                newRFPProdList.add(newRFPProd);
                Save();
                addquestions();
            }
        }
        return null;
    }
    public boolean displayPopup {get; set;}
    public rfp_question__c newManualQ {get;set;}
    
    public PageReference closePopup()
    {
        displayPopup = false;
        return null;
    }
    public PageReference AddnewManualQ(){
        displayPopup = false;
        if(newManualQ != null)
            upsert newManualQ;
        reOrder();
        getQuestions();
        return null;
    }
    public PageReference AddManualQuestions (){
        newManualQ = new rfp_question__c();
        displayPopup = true;
        ID ManualQuestionId;
        for (question__c rid: [select id from question__c where name ='Manual question' limit 1]){
            ManualQuestionId = rid.id;
        }
        newManualQ.Question__c = ManualQuestionId;
        newManualQ.RFP__c = RFPId;
        newManualQ.Question_Text__c = '';
        newManualQ.Type__c = '';
        newManualQ.Subgroup__c = '';
        newManualQ.ProductName__c = '';
        //newManualQ.Chapter__c = '';
        return null;
    }
    public PageReference AddOptInQuestions (){
        List<rfp_question__c> rqlist = new List<rfp_question__c>();
        if(UserSelectOptInQ!= null){
            if (!setOptInQ.contains(UserSelectOptInQ)){
                for(Question_Product__c c: [SELECT Question__r.Id, Question__c, Product__c, Question__r.Question_Text__c, Question__r.type__c,Question__r.Chapter__c, Question__r.Subgroup__c, Product__r.name 
                                            FROM Question_Product__c WHERE Question__r.Opt_in_question__c =:true and Question__r.Subgroup__c=:UserSelectOptInQ limit 100]){
                                                RFP_Question__c rq = new RFP_Question__c();
                                                rq.Question__c = c.Question__r.id;
                                                rq.Question_Text__c = c.Question__r.Question_Text__c;
                                                rq.RFP__c = RFPId;
                                                rq.Product__c = c.Product__c;
                                                //rq.Unique_ID__c = RFPId + '-' + c.Question__r.ID;
                                                rq.Type__c = c.Question__r.Type__c;
                                                rq.Subgroup__c = c.Question__r.Subgroup__c;
                                                rq.Chapter__c = c.Question__r.Chapter__c;
                                                rq.ProductName__c = c.Product__r.name;
                                                rq.status__C = 'Active';
                                                selectedOptInQuestions.add(rq);
                                            }
                setOptInQ.add(UserSelectOptInQ);
                OptInQ.add(UserSelectOptInQ);
            }
            if(selectedOptInQuestions.size()>0)
                upsert selectedOptInQuestions;
        }
                    Integer i;
            for(rfp_question__c ri: [select no__c  from rfp_question__c where Status__c != 'Removed' and RFP__c=:RFPId and no__c != null order by no__c desc limit 1]){
                i = Integer.valueOf(ri.no__c);
            }
            if (i == null)
                i = 0;
            List<rfp_question__c> rqlist1 = new List<rfp_question__c>();
            for(rfp_question__c rq: [select id, no__c, Question__r.Subgroup__c, Question__r.Type__c, Product__r.name from rfp_question__c 
                                     where RFP__c=:RFPId and no__c = null]){
                                         i++;
                                         rq.no__c = i;
                                         rqlist1.add(rq);
                                     }
            if(rqlist1.size()>0)
                upsert rqlist1;
        return null;
    }
    public PageReference reOrder(){
            Integer i;
            boolean reOrder = false;
            List<rfp_question__c> rqlist1 = new List<rfp_question__c>([select id, no__c from rfp_question__c rq where Status__c != 'Removed' and RFP__c=:RFPId order by no__c,Product__c ]);
            i = rqlist1.size();
            //system.debug('rqlist1size'+i);
        for (Integer j= 1;j<= i; j++){
            //system.debug('jsize'+j);
            //system.debug('isize'+Integer.valueof(rqlist1.get(j-1).no__c));
            if (j != Integer.valueof(rqlist1.get(j-1).no__c)){
                reOrder = true;
                break;
            }   
        }
        if (reOrder){
            i =0;
            List<rfp_question__c> rqlist2 = new List<rfp_question__c>();
            for(rfp_question__c rq: rqlist1){
                                         i++;
                                         rq.no__c = i;
                                        rqlist2.add(rq);
                                     }
            if(rqlist2.size()>0)
                upsert rqlist2;
        }
        getQuestions();
        return null;
    }
    public PageReference Del (){
        Integer dmlrows = Limits.getLimitDMLRows();
        Integer curdmlrows = Limits.getDMLRows(); 
        Integer remainingdmlrows = dmlrows - curdmlrows;
        
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('index'));  
        
        if (newRFPProdList.get(indexVal - 1).id!=null)
            delRFPProdList.add(newRFPProdList.get(indexVal - 1));
        
        Id prodid = newRFPProdList.get(indexVal - 1).Product__c;  
        system.debug('selectedprodid'+prodid);
        try{
        delete [select ID from rfp_question__c where rfp__c = :rfpID and product__c =: prodid];
        remainingdmlrows = dmlrows - curdmlrows;
        
        newprd.remove(indexVal - 1);
        newRFPProdList.remove(indexVal - 1);
        
        if(delRFPProdList.size()>0)
            delete delRFPProdList;
        delRFPProdList.clear();
        }
        catch (Exception e) {
          String  message  = '[ PACRES ] Exception: ' + e.getMessage() + '; line: ' + e.getLineNumber() ;
            //ApexPages.addMessage(message);
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL, '[ PACRES ] Exception: ' + e.getMessage() ));
            exceptionMessages += message + '\n\n';
        }
        return null;
    }
    public PageReference DelOpInQ (){
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('index1'));
        String q = OptInQ.get(indexVal - 1);
        delete [select ID from rfp_question__c where rfp__c = :rfpID and SubGroup__c =: q];
        OptInQ.remove(indexVal - 1);
        return null;
    }
    public PageReference Delcar (){
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('indexcar'));
        if (newcarrier.get(indexVal - 1).id!=null)
            delcarrier.add(newcarrier.get(indexVal - 1));
        newcarrier.remove(indexVal - 1);
        return null;
    }
    public PageReference Save (){
        if(newRFPProdList.size()>0)
            upsert newRFPProdList;
        if(delRFPProdList.size()>0)
            delete delRFPProdList;
        return null;
    }
    public PageReference Savecar (){
        if(newcarrier.size()>0)
            upsert newcarrier;
        if(delcarrier.size()>0)
            delete delcarrier;
        return null;
    }
    public PageReference SaveQuestions (){
        selectedQuestions.clear();
        for (CCWRow c: tRecords){
            if(c.IsSelected == true){
                //c.tContact.Status__c = 'Active';
                selectedQuestions.add(c.tContact);    
            }
        }
        if(selectedQuestions.size()>0)
            upsert selectedQuestions;
        reOrder();
        getQuestions();
        return null;
    }
    public PageReference quickSaveQ (){
        selectedQuestions.clear();
        for (CCWRow c: tRecords){
            //if(c.IsSelected == true){
                selectedQuestions.add(c.tContact);
              //  break;
            //}
        }
        if(selectedQuestions.size()>0)
            upsert selectedQuestions;
                reOrder();
        getQuestions();
        return null;
    }
    public PageReference removeselected(){
        selectedQuestions.clear();
        for (CCWRow c: tRecords){
            if(c.IsSelected == true){
                c.tContact.Status__c = 'Removed';
                selectedQuestions.add(c.tContact);    
            }
        }
        if(selectedQuestions.size()>0)
            upsert selectedQuestions;
        reOrder();
        getQuestions();
        return null;
    }
    public List<SelectOption> getListVal()
    { 
        List<SelectOption> listValues = new List<SelectOption>();
        listValues.add(new SelectOption('','--None--'));
        String prodfamily;
        if (UserSelectFamily != null){
            for(Product2 pname: [select name from Product2 where family=:UserSelectFamily and type__c = 'Plan level' limit 200])
            {
                listValues.add(new SelectOption(pname.name,pname.name));
            }
            
        }else
        {
            for(Product2 pname: [select name from Product2 where type__c = 'Plan level' limit 200])
            {
                listValues.add(new SelectOption(pname.name,pname.name));
            }
        }
        return listValues;
    }
    public PageReference updfamily(){
        UserSelectFamily = product.family;
        return null;
    }
    public List<selectOption> getmultiListVal() {
        List<SelectOption> listValues = new List<SelectOption>();
        set<selectOption> setValues = new set<selectOption>();
        listValues.add(new SelectOption('','--None--'));
        for(Question__c qobject: [select Subgroup__c from Question__c WHERE Opt_in_question__c = true AND Subgroup__c != null AND ID in (select question__c from question_product__c where Product__c in :productIDs) limit 500])
        {          
            setValues.add(new SelectOption(qobject.Subgroup__c,qobject.Subgroup__c));
        }
        listValues.addAll(setValues);
        return listValues;
    }
    public List<selectOption> getpagesizeVal() {
        List<SelectOption> listValues = new List<SelectOption>();
        listValues.add(new SelectOption('10','10'));
        listValues.add(new SelectOption('20','20'));
        listValues.add(new SelectOption('30','30'));
        listValues.add(new SelectOption('50','50'));
        listValues.add(new SelectOption('100','100'));
        return listValues;
    }
    public PageReference Addcarrier(){
        if(carrier.Key_Contact__c!=null)
            UserSelectCarrier = carrier.Key_Contact__c;     
        system.debug('CarrierID'+UserSelectCarrier);
        iF (UserSelectCarrier!=NULL){
            newcontact = new List<Contact>();
            Contact addedcontact = [select id, name, Account.name from Contact where id=: UserSelectCarrier];
            Carrier_Response_Status__c addedcarrier = new Carrier_Response_Status__c();
            addedcarrier.name = addedcontact.account.name;
            addedcarrier.Key_Contact__c = addedcontact.id;
            addedcarrier.Status__c = 'Open';
            addedcarrier.RFP__c = RFPId;
            newcarrier.add(addedcarrier);
        }
        return null;
    }
    public PageReference exitpage(){
        PageReference returnPage = new PageReference('/'+RFPId); 
        returnPage.setRedirect(true);
        return returnPage;
    }
    public Product2 getProduct(){
        if(product == null) product = new Product2();
        return product;
    }
    public boolean getistab1disabled() {
        return selectedTab <> 'tab1';
    }
    
    public boolean getistab2disabled() {
        return selectedTab <> 'tab2';
    }
    public boolean getistab3disabled() {
        return selectedTab <> 'tab3';
    }
    
    public boolean getistab4disabled() {
        return selectedTab <> 'tab4';
    }
    public boolean getistab5disabled() {
        return selectedTab <> 'tab5';
    }
  
Hi,
I am going to start a new project that digital sales aid (DSA) in ipad.the main concept of this project is giving demos for the clients to by using ipad.so can you please help me out to how i can start and what is the procedure?
thanks in advance.
public class myException extends exception {}  
over next public class controller
{
try{ void myexception () ] catch( exception e); catch(myexception me);
}over
question is ... which exception fires?

i have three text field called first name,middle name,last name.i want to make them unique using admin.how?
hi,i got a question from my higher that what is difference between custom process and approval process?
first i would like to know what is custom process?
Hi,
I need a test code for this pagereference method ..its with for loops and if conditions..so help me to findout this.
Thanks in advance.
public PageReference Del (){
        Integer dmlrows = Limits.getLimitDMLRows();
        Integer curdmlrows = Limits.getDMLRows(); 
        Integer remainingdmlrows = dmlrows - curdmlrows;
        
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('index'));  
        
        if (newRFPProdList.get(indexVal - 1).id!=null)
            delRFPProdList.add(newRFPProdList.get(indexVal - 1));
        
        Id prodid = newRFPProdList.get(indexVal - 1).Product__c;  
        system.debug('selectedprodid'+prodid);
        try{
        delete [select ID from rfp_question__c where rfp__c = :rfpID and product__c =: prodid];
        remainingdmlrows = dmlrows - curdmlrows;
        
        newprd.remove(indexVal - 1);
        newRFPProdList.remove(indexVal - 1);
        
        if(delRFPProdList.size()>0)
            delete delRFPProdList;
        delRFPProdList.clear();
        }
        catch (Exception e) {
          String  message  = '[ PACRES ] Exception: ' + e.getMessage() + '; line: ' + e.getLineNumber() ;
            //ApexPages.addMessage(message);
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL, '[ PACRES ] Exception: ' + e.getMessage() ));
            exceptionMessages += message + '\n\n';
        }
        return null;
    }
I created an email alert in a trigger.it's not displaying images(custom html).how could i send email alert with HTML template with letter head.I dont think it doesn't support.is it? below is my code.
 
EmailTemplate template=[SELECT HtmlValue,Body FROM EmailTemplate WHERE Name='SpamCatchTest1'];     //custom html )(without letterhead)template

if(newCase.Origin =='Email' && newCase.SuppliedEmail !=null ) { String hbody=''; String 

plainTxtBody=''; hbody=template.HtmlValue; hbody=hbody.replace('{!Contact.Name}',k); plainTxtBody=template.Body;
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>(); Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); List<String> sendTo = new List<String>(); 

sendTo.add(newCase.SuppliedEmail ); System.debug(newCase.SuppliedEmail); mail.setToAddresses(sendTo); OrgWideEmailAddress[] owea = [select Id from 

OrgWideEmailAddress where Address = 'portal.support@nexenta.com']; //mail.setReplyTo('portal.support@xxx.com'); 
List<String> ccTo = new List<String>(); ccTo.add('satheesh.thondamanti@xxx.com'); 
mail.setCcAddresses(ccTo); 
mail.setTemplateID(template.Id);//This is the template you are setting mail.setSubject('Email to Case Response'); 
//String body = 'Dear ' + Contact.FirstName + Contact.LastName + ', ';
 //body += 'Thank you for your email. Your support request cannot be processed at the moment. Support is available only for Nexenta customers who has valid support contract.For any queries on your community edition, please go to  and post your query. If you have valid support contract, please get in touch with your Nexenta sales team with purchase details to get access to Nexenta support portal.'; mail.setOrgWideEmailAddressId(owea.get(0).Id); 
mail.setHtmlBody(hbody); 
// mail.setPlainTextBody(plainTxtBody); 
// mail.setTreatTargetObjectAsRecipient(true);
 mails.add(mail); System.debug(mail); 
Messaging.sendEmail(mails); 
//Messaging.SendEmailResult[] results = Messaging.sendEmail(messages); }
Hi,
I need a test code for this pagereference method ..its with for loops and if conditions..so help me to findout this.
Thanks in advance.
public PageReference Del (){
        Integer dmlrows = Limits.getLimitDMLRows();
        Integer curdmlrows = Limits.getDMLRows(); 
        Integer remainingdmlrows = dmlrows - curdmlrows;
        
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('index'));  
        
        if (newRFPProdList.get(indexVal - 1).id!=null)
            delRFPProdList.add(newRFPProdList.get(indexVal - 1));
        
        Id prodid = newRFPProdList.get(indexVal - 1).Product__c;  
        system.debug('selectedprodid'+prodid);
        try{
        delete [select ID from rfp_question__c where rfp__c = :rfpID and product__c =: prodid];
        remainingdmlrows = dmlrows - curdmlrows;
        
        newprd.remove(indexVal - 1);
        newRFPProdList.remove(indexVal - 1);
        
        if(delRFPProdList.size()>0)
            delete delRFPProdList;
        delRFPProdList.clear();
        }
        catch (Exception e) {
          String  message  = '[ PACRES ] Exception: ' + e.getMessage() + '; line: ' + e.getLineNumber() ;
            //ApexPages.addMessage(message);
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL, '[ PACRES ] Exception: ' + e.getMessage() ));
            exceptionMessages += message + '\n\n';
        }
        return null;
    }
public class newRFPController {
    public Product2 product;
    public Question__c question {get;set;}
    public Carrier_Response_Status__c carrier {get;set;}
    public Contact contact {get;set;}
    public Question_Product__c questionproduct {get;set;}
    public string UserSelectVAlue {set;get;}
    public string UserSelectOptInQ {set;get;}
    public String UserSelectFamily {get;set;}
    public string UserSelectCarrier {set;get;}     
    public boolean OptInQuestion {set;get;}
    public List<Product2> newprd {set;get;}
    public List<Contact> newcontact {set;get;}
    public List<Carrier_Response_Status__c> newcarrier {set;get;}
    private string selectedtab;
    public Set<id> productIds;
    public Id RFPId;
    public list<RFP_Product__c> newRFPProdList {set;get;}
    public list<RFP_Product__c> delRFPProdList;
    public list<Carrier_Response_Status__c> delcarrier;
    public List<CCWRow> tRecords{get;set;}
    public List<RFP_Question__c> selectedQuestions{get;set;}
    public List<RFP_Question__c> selectedOptInQuestions{get;set;}
    public List<Question_Product__c> editQuestions {get;set;}
    public String sDeveloperName;
    public String RFPname {set;get;}
    private string exceptionMessages = ''; 
    public list<String> OptInQ {get;set;}
    set<String> setOptInQ = new set<String>();
    public ID targetQuestionId {set;get;}
    private String [] m_lstVals = new String[]{};
        public void setValues (String [] lstVals) { 
            this.m_lstVals = lstVals;
            system.debug('m_lstVals1'+m_lstVals);
        } 
    public String [] getValues () { 
        system.debug('m_lstVals1'+m_lstVals);
        return m_lstVals; 
    } 
    public newRFPController(){
        this.newprd = new List<Product2>();
        this.newcarrier = new List<Carrier_Response_Status__c>();
        this.delcarrier = new List<Carrier_Response_Status__c>();
        this.carrier = new Carrier_Response_Status__c();
        this.contact = new Contact();
        this.productIds = new Set<id>();
        this.selectedTab = 'tab1';
        this.OptInQuestion = false;
        this.RFPId = ApexPages.currentPage().getParameters().get('id');
        this.newRFPProdList = new list<RFP_Product__c>();
        this.delRFPProdList = new list<RFP_Product__c>();
        this.tRecords = new List<CCWRow>();
        this.selectedQuestions = new List<RFP_Question__c>();
        this.selectedOptInQuestions = new List<RFP_Question__c>();
        this.OptInQ = new list<String>();
        //set initial page
        this.page = 1;
        pageSize = 10;
        displayPopup = false;
        for (RFP_Product__c existingprd: [select id, Product__r.id,Productname__c, Description__c, Productcode__c, ProductFamily__c from RFP_Product__c where Product__r.type__c = 'Plan level' and RFP__c=:RFPId]){
            Product2 addedprd = new Product2();
            addedprd.id = existingprd.Product__r.id;
            newprd.add(addedprd);
            productIds.add(addedprd.id);
            newRFPProdList.add(existingprd);
        }
        for(Question__c q: [select SubGroup__c from Question__c where Opt_in_question__c = true and id in (select Question__c from rfp_question__c where RFP__c=:RFPId)]){            
            if (q != null){
                setOptInQ.add(q.SubGroup__c);                
            }
        }
        OptInQ.addAll(setOptInQ);
        for (Carrier_Response_Status__c existingcar: [select id, name,Key_Contact__c, Locked__c, Status__c from Carrier_Response_Status__c where RFP__c=:RFPId ]){
            newcarrier.add(existingcar);
        }
        for (rfp__c r: [select name from rfp__c where id=: RFPId Limit 1]){
            RFPName = r.name;
        }
    }
    public PageReference Add (){
        boolean duplicate = false;
        if(UserSelectVAlue != null){
            Product2 addedprd = [select id,name, Description, ProductCode, Family from Product2 where name=: UserSelectVAlue];
            addedprd.Description = addedprd.name;
            for (Product2 prd: newprd){
                if(prd.id == addedprd.Id){
                    duplicate = true;
                    break;
                }   
            }
            if (!duplicate){
                newprd.add(addedprd);
                productIds.add(addedprd.id);
                RFP_Product__c newRFPProd = new RFP_Product__c();
                newRFPProd.Product__c = addedprd.id;
                newRFPProd.RFP__c = RFPId;
                newRFPProd.Description__c = addedprd.Description;
                newRFPProd.Productname__c = addedprd.name;
                newRFPProd.Productcode__c = addedprd.ProductCode;
                newRFPProd.ProductFamily__c = addedprd.Family;
                newRFPProdList.add(newRFPProd);
                Save();
                addquestions();
            }
        }
        return null;
    }
    public boolean displayPopup {get; set;}
    public rfp_question__c newManualQ {get;set;}
    
    public PageReference closePopup()
    {
        displayPopup = false;
        return null;
    }
    public PageReference AddnewManualQ(){
        displayPopup = false;
        if(newManualQ != null)
            upsert newManualQ;
        reOrder();
        getQuestions();
        return null;
    }
    public PageReference AddManualQuestions (){
        newManualQ = new rfp_question__c();
        displayPopup = true;
        ID ManualQuestionId;
        for (question__c rid: [select id from question__c where name ='Manual question' limit 1]){
            ManualQuestionId = rid.id;
        }
        newManualQ.Question__c = ManualQuestionId;
        newManualQ.RFP__c = RFPId;
        newManualQ.Question_Text__c = '';
        newManualQ.Type__c = '';
        newManualQ.Subgroup__c = '';
        newManualQ.ProductName__c = '';
        //newManualQ.Chapter__c = '';
        return null;
    }
    public PageReference AddOptInQuestions (){
        List<rfp_question__c> rqlist = new List<rfp_question__c>();
        if(UserSelectOptInQ!= null){
            if (!setOptInQ.contains(UserSelectOptInQ)){
                for(Question_Product__c c: [SELECT Question__r.Id, Question__c, Product__c, Question__r.Question_Text__c, Question__r.type__c,Question__r.Chapter__c, Question__r.Subgroup__c, Product__r.name 
                                            FROM Question_Product__c WHERE Question__r.Opt_in_question__c =:true and Question__r.Subgroup__c=:UserSelectOptInQ limit 100]){
                                                RFP_Question__c rq = new RFP_Question__c();
                                                rq.Question__c = c.Question__r.id;
                                                rq.Question_Text__c = c.Question__r.Question_Text__c;
                                                rq.RFP__c = RFPId;
                                                rq.Product__c = c.Product__c;
                                                //rq.Unique_ID__c = RFPId + '-' + c.Question__r.ID;
                                                rq.Type__c = c.Question__r.Type__c;
                                                rq.Subgroup__c = c.Question__r.Subgroup__c;
                                                rq.Chapter__c = c.Question__r.Chapter__c;
                                                rq.ProductName__c = c.Product__r.name;
                                                rq.status__C = 'Active';
                                                selectedOptInQuestions.add(rq);
                                            }
                setOptInQ.add(UserSelectOptInQ);
                OptInQ.add(UserSelectOptInQ);
            }
            if(selectedOptInQuestions.size()>0)
                upsert selectedOptInQuestions;
        }
                    Integer i;
            for(rfp_question__c ri: [select no__c  from rfp_question__c where Status__c != 'Removed' and RFP__c=:RFPId and no__c != null order by no__c desc limit 1]){
                i = Integer.valueOf(ri.no__c);
            }
            if (i == null)
                i = 0;
            List<rfp_question__c> rqlist1 = new List<rfp_question__c>();
            for(rfp_question__c rq: [select id, no__c, Question__r.Subgroup__c, Question__r.Type__c, Product__r.name from rfp_question__c 
                                     where RFP__c=:RFPId and no__c = null]){
                                         i++;
                                         rq.no__c = i;
                                         rqlist1.add(rq);
                                     }
            if(rqlist1.size()>0)
                upsert rqlist1;
        return null;
    }
    public PageReference reOrder(){
            Integer i;
            boolean reOrder = false;
            List<rfp_question__c> rqlist1 = new List<rfp_question__c>([select id, no__c from rfp_question__c rq where Status__c != 'Removed' and RFP__c=:RFPId order by no__c,Product__c ]);
            i = rqlist1.size();
            //system.debug('rqlist1size'+i);
        for (Integer j= 1;j<= i; j++){
            //system.debug('jsize'+j);
            //system.debug('isize'+Integer.valueof(rqlist1.get(j-1).no__c));
            if (j != Integer.valueof(rqlist1.get(j-1).no__c)){
                reOrder = true;
                break;
            }   
        }
        if (reOrder){
            i =0;
            List<rfp_question__c> rqlist2 = new List<rfp_question__c>();
            for(rfp_question__c rq: rqlist1){
                                         i++;
                                         rq.no__c = i;
                                        rqlist2.add(rq);
                                     }
            if(rqlist2.size()>0)
                upsert rqlist2;
        }
        getQuestions();
        return null;
    }
    public PageReference Del (){
        Integer dmlrows = Limits.getLimitDMLRows();
        Integer curdmlrows = Limits.getDMLRows(); 
        Integer remainingdmlrows = dmlrows - curdmlrows;
        
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('index'));  
        
        if (newRFPProdList.get(indexVal - 1).id!=null)
            delRFPProdList.add(newRFPProdList.get(indexVal - 1));
        
        Id prodid = newRFPProdList.get(indexVal - 1).Product__c;  
        system.debug('selectedprodid'+prodid);
        try{
        delete [select ID from rfp_question__c where rfp__c = :rfpID and product__c =: prodid];
        remainingdmlrows = dmlrows - curdmlrows;
        
        newprd.remove(indexVal - 1);
        newRFPProdList.remove(indexVal - 1);
        
        if(delRFPProdList.size()>0)
            delete delRFPProdList;
        delRFPProdList.clear();
        }
        catch (Exception e) {
          String  message  = '[ PACRES ] Exception: ' + e.getMessage() + '; line: ' + e.getLineNumber() ;
            //ApexPages.addMessage(message);
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL, '[ PACRES ] Exception: ' + e.getMessage() ));
            exceptionMessages += message + '\n\n';
        }
        return null;
    }
    public PageReference DelOpInQ (){
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('index1'));
        String q = OptInQ.get(indexVal - 1);
        delete [select ID from rfp_question__c where rfp__c = :rfpID and SubGroup__c =: q];
        OptInQ.remove(indexVal - 1);
        return null;
    }
    public PageReference Delcar (){
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('indexcar'));
        if (newcarrier.get(indexVal - 1).id!=null)
            delcarrier.add(newcarrier.get(indexVal - 1));
        newcarrier.remove(indexVal - 1);
        return null;
    }
    public PageReference Save (){
        if(newRFPProdList.size()>0)
            upsert newRFPProdList;
        if(delRFPProdList.size()>0)
            delete delRFPProdList;
        return null;
    }
    public PageReference Savecar (){
        if(newcarrier.size()>0)
            upsert newcarrier;
        if(delcarrier.size()>0)
            delete delcarrier;
        return null;
    }
    public PageReference SaveQuestions (){
        selectedQuestions.clear();
        for (CCWRow c: tRecords){
            if(c.IsSelected == true){
                //c.tContact.Status__c = 'Active';
                selectedQuestions.add(c.tContact);    
            }
        }
        if(selectedQuestions.size()>0)
            upsert selectedQuestions;
        reOrder();
        getQuestions();
        return null;
    }
    public PageReference quickSaveQ (){
        selectedQuestions.clear();
        for (CCWRow c: tRecords){
            //if(c.IsSelected == true){
                selectedQuestions.add(c.tContact);
              //  break;
            //}
        }
        if(selectedQuestions.size()>0)
            upsert selectedQuestions;
                reOrder();
        getQuestions();
        return null;
    }
    public PageReference removeselected(){
        selectedQuestions.clear();
        for (CCWRow c: tRecords){
            if(c.IsSelected == true){
                c.tContact.Status__c = 'Removed';
                selectedQuestions.add(c.tContact);    
            }
        }
        if(selectedQuestions.size()>0)
            upsert selectedQuestions;
        reOrder();
        getQuestions();
        return null;
    }
    public List<SelectOption> getListVal()
    { 
        List<SelectOption> listValues = new List<SelectOption>();
        listValues.add(new SelectOption('','--None--'));
        String prodfamily;
        if (UserSelectFamily != null){
            for(Product2 pname: [select name from Product2 where family=:UserSelectFamily and type__c = 'Plan level' limit 200])
            {
                listValues.add(new SelectOption(pname.name,pname.name));
            }
            
        }else
        {
            for(Product2 pname: [select name from Product2 where type__c = 'Plan level' limit 200])
            {
                listValues.add(new SelectOption(pname.name,pname.name));
            }
        }
        return listValues;
    }
    public PageReference updfamily(){
        UserSelectFamily = product.family;
        return null;
    }
    public List<selectOption> getmultiListVal() {
        List<SelectOption> listValues = new List<SelectOption>();
        set<selectOption> setValues = new set<selectOption>();
        listValues.add(new SelectOption('','--None--'));
        for(Question__c qobject: [select Subgroup__c from Question__c WHERE Opt_in_question__c = true AND Subgroup__c != null AND ID in (select question__c from question_product__c where Product__c in :productIDs) limit 500])
        {          
            setValues.add(new SelectOption(qobject.Subgroup__c,qobject.Subgroup__c));
        }
        listValues.addAll(setValues);
        return listValues;
    }
    public List<selectOption> getpagesizeVal() {
        List<SelectOption> listValues = new List<SelectOption>();
        listValues.add(new SelectOption('10','10'));
        listValues.add(new SelectOption('20','20'));
        listValues.add(new SelectOption('30','30'));
        listValues.add(new SelectOption('50','50'));
        listValues.add(new SelectOption('100','100'));
        return listValues;
    }
    public PageReference Addcarrier(){
        if(carrier.Key_Contact__c!=null)
            UserSelectCarrier = carrier.Key_Contact__c;     
        system.debug('CarrierID'+UserSelectCarrier);
        iF (UserSelectCarrier!=NULL){
            newcontact = new List<Contact>();
            Contact addedcontact = [select id, name, Account.name from Contact where id=: UserSelectCarrier];
            Carrier_Response_Status__c addedcarrier = new Carrier_Response_Status__c();
            addedcarrier.name = addedcontact.account.name;
            addedcarrier.Key_Contact__c = addedcontact.id;
            addedcarrier.Status__c = 'Open';
            addedcarrier.RFP__c = RFPId;
            newcarrier.add(addedcarrier);
        }
        return null;
    }
    public PageReference exitpage(){
        PageReference returnPage = new PageReference('/'+RFPId); 
        returnPage.setRedirect(true);
        return returnPage;
    }
    public Product2 getProduct(){
        if(product == null) product = new Product2();
        return product;
    }
    public boolean getistab1disabled() {
        return selectedTab <> 'tab1';
    }
    
    public boolean getistab2disabled() {
        return selectedTab <> 'tab2';
    }
    public boolean getistab3disabled() {
        return selectedTab <> 'tab3';
    }
    
    public boolean getistab4disabled() {
        return selectedTab <> 'tab4';
    }
    public boolean getistab5disabled() {
        return selectedTab <> 'tab5';
    }
  
hi,i got a question from my higher that what is difference between custom process and approval process?
first i would like to know what is custom process?
I am getting an error while i am creating custom controller visualforce page  with account fields. getting error " Mycustom Compile Error: Method does not exist or incorrect signature: [System.PageReference].get(String) at line 5 column 184" 
my programme is

public class Mycustom {
public Account acc;
public Mycustom()
{
acc=[select id,name,phone,industry,website,rating,billingcity,description,fax,shippingcity,annualrevenue,billingcountry,shippingcountry from account where id=:apexpages.currentpage().get('id')];
}
public account getaccount()
{
return acc;
}
public pagereference savemethod()
{
update acc;
pagereference pageref=new apexpages.standardcontroller(acc).view();
return pageref;
}
}


and my controller page is

<apex:page controller="Mycustom" tabstyle="Account">
<apex:form >
<apex:pageblock title="account detail">
<apex:pageblocksection> title="account details1">
<apex:inputfield value="{account.Name}"/>
<apex:inputfield value="{account.phone}"/>
<apex:inputfield value="{account.industry}"/>
<apex:inputfield value="{account.rating}"/>
<apex:inputfield value="{account.website}"/>
</apex:pageblocksection>
<apex:pageblockSection title="account deatail2">
<apex:inputfield value="{account.billingcity}"/>
<apex:inputfield value="{account.billingcountry}"/>
<apex:inputfield value="{account.description}"/>
<apex:inputfield value="{account.fax}"/>
<apex:inputfield value="{account.shippingcity}"/>
<apex:inputfield value="{account.shippingcountry}"/>
<apex:inputfield value="{account.annualrevenue}"/>
</apex:pageblockSection>
</apex:pageblock>
</apex:form>
</apex:page>