• Kathir Devan
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 21
    Questions
  • 57
    Replies
Hi,
 
I have created some web tabs and VF tabs.I would like to give sharing setting option, but it does not appear any web tabs and VF tabs..
I mean goto-->sharing seting -->Manage sharing settings for :All object-->inside this option there is no appear my VF tap and web tabs).can any one give some suggestion..

Thanks,
kathir
Hi,

        I have created permission set  its for not working properly.My requirement is two users(like user A,user B) both are having same role and same profile.. I want to give object level premission set that is VF tab.My VF Tab having two option only that is (available and visible) User A  need to be access available only and User B need to be access  available and visible only. Actually this task am trying for both user for accessing same permission,but i given different permission set both users.How can i do this.. please can any one give suggestion..



Thanks,
kathir

Hi,

 My requirement is i have two user have same profile and same role, i need give permit for read and write like that to particular tab like account for one user  only,
other user not able to access anything.. how can i do this.. please can any one help me...

Thanks,
kathir
Hi,

I have created custom  field that is email in Custom object. I need to display email field in custom object A when i save the button.Code is working fine but email field not saved in Custom object .Why this happening.could you give any suggestion thanks in advance.

My VF code:
<apex:page Controller="kathir">
<apex:form >
    <apex:pageBlock title="Universal Containers">
      
            <apex:outputLabel value="Email Address" for="hh"/>
            <apex:inputText value="{!Email}" id="hh"/>
            <apex:commandButton value="save" action="{!save}"/>
      
</apex:pageBlock>
    </apex:form>
</apex:page>

Controller:
public class kathir{    public PageReference save() {        return null;    }    public String email{ get; set; }    public String getAccount() {        return null;    }    public String account { get; set; }public string Name{get;set;}{}public string Information{get;set;}{}}
hi,
     here i hav attached my vf and controller code,i hav found the following error... DML requires SObject or SObject list type.....kindly anyone of u help me friends

vf code:
              
<apex:page StandardController="Account" extensions="MultiAdd" id="thePage">
<apex:form >
<apex:pageblock id="pb" >
    <apex:pageBlockButtons >
        <apex:commandbutton value="Add" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save" action="{!Save}"/>
    </apex:pageBlockButtons>
   
       
        <apex:pageblock id="pb1">
           
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="5">
               
                <apex:panelGrid headerClass="Name">
                    <apex:facet name="header">Del</apex:facet>
                    <apex:commandButton value="X" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>  
               
                <apex:panelGrid title="SPD" >
                    <apex:facet name="header">Country</apex:facet>
                    <apex:inputfield value="{!e1.acct.ShippingCountry}"/>
                </apex:panelGrid>
               
                <apex:panelGrid >
                    <apex:facet name="header">IsActive</apex:facet>
                    <apex:inputfield value="{!e1.acct.Active__c}"/>
                </apex:panelGrid>
               
                <apex:panelGrid >
                    <apex:facet name="header">Name</apex:facet>
                    <apex:inputfield value="{!e1.acct.Name}"/>
                </apex:panelGrid>
            </apex:panelgrid>
        </apex:repeat>
    </apex:pageBlock>
       
</apex:pageblock>
</apex:form>
</apex:page>

controller:

public class MultiAdd
{
   
    //will hold the account records to be saved
    public List<Account>lstAcct  = new List<Account>();
   
    //list of the inner class
    public List<innerClass> lstInner
    {   get;set;    }
   
    //will indicate the row to be deleted
    public String selectedRowIndex
    {get;set;} 
   
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}
   
   
    ////save the records by adding the elements in the inner class list to lstAcct,return to the same page
    public PageReference Save()
    {
        PageReference pr = new PageReference('/apex/customlookup');
       
        for(Integer j = 0;j<lstInner.size();j++)
        {
            lstAcct.add(lstInner[j].acct);
        }
        insert lstAcct;
        pr.setRedirect(True);
        return pr;
    }
       
    //add one more row
    public void Add()
    {  
        count = count+1;
        addMore();     
    }
   
    /*Begin addMore*/
    public void addMore()
    {
        //call to the iner class constructor
        innerClass objInnerClass = new innerClass(count);
       
        //add the record to the inner class list
        lstInner.add(objInnerClass);   
        system.debug('lstInner---->'+lstInner);           
    }/* end addMore*/
   
    /* begin delete */
    public void Del()
    {
        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;
       
    }/*End del*/
   
   
   
    /*Constructor*/
    public MultiAdd(ApexPages.StandardController ctlr)
    {
   
        lstInner = new List<innerClass>();
        addMore();
        selectedRowIndex = '0';
       
    }/*End Constructor*/
       


    /*Inner Class*/
    public class innerClass
    {      
        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */
        public String recCount
        {get;set;}
       
       
        public Account acct
        {get;set;}
       
        /*Inner Class Constructor*/
        public innerClass(Integer intCount)
        {
            recCount = String.valueOf(intCount);       
           
            /*create a new account*/
            acct = new Account();
           
        }/*End Inner class Constructor*/   
    }/*End inner Class*/
}/*End Class*/


                                                                                                    thanks in advance!!!!!!!!!!!!!

Hi friends,

 

Could you tell me any one resolve time limt exceeded problem,Am very  struggle to handle this issue  but not resolve this issue please can anyone help me..

 

Regards,

kathir 

Hi friends,

 

Is it possible to increase cpu time limit speed in javascript,if its possible please give me suggestion.

 

 

Regards,

kathir

Hi Friends,

 

I would like to searching  in search option exclamation symbol (!) but this symbol is not searching in search option..Actually i need to search != null this option but not working when i search this symbol cursor goes to first line always..can anyone tel me why this err occur.thanks in advance...

 

Regards,

kathir

Hi friends,

 

I have list of records,when i click the particular records it display the details of records.some records not display it's loading too long time after that am getting err like this.. Apex CPU time limit exceeded and An unexpected error has occurred. Your development organization has been notifiedwhy this err occur how to resolve this please can anyone help me..thanks in advance..

 

Regards,

kathir

Hi friends,

 

My query..is it possible to give multiple comment lines at the time that means if i select more then 10 lines i need to  give comment line at the sametime without  this option /*--comment lines--*/

 

Regards,

kathir

Hi,

 

I have create pagination list of records previous and next like.Totaly i have above 10000 records.i have created 75 records per pages.when i click next pages it display the 75 records as for same process add 75 records that means 150.Actually i have two problem first one is display the records too late that means it take too long time.Second one is upto 2000 records is display from pagination after 2000 records dost not appear any records but it's added 75 records...why this happen 

How to resolve this problem,please can any one help my query....

 

 

Regards,

kathir

 

Hi dears,

 

Am getting err too many queries..Here attach my classes, Actually where do i write list collection please can anyone tel me...

public PageReference Save()
{
  
    /////////// LEVEL 1 ///////////////////
   List<level1s__c> selectLevel1 = new List<level1s__c>();
   List<level1s__c> selectedLevel1 = new List<level1s__c>(); 
   
   for(Level1sClass con: getList1Details())
    {
        system.debug('con'+con.selected);
        if(con.selected == true)
        {
            system.debug('firstCCCCCCCCCC:'+con.lev1);
            selectedLevel1.add(con.lev1);
        }
      
  
    Level1__c[] levl1= [Select Id from Level1__c where Account__c=: ApexPages.currentPage().getParameters().get('id')]; 
    delete levl1; 
    if(selectedLevel1 != null)
     { 
      for(level1s__c cCon: selectedLevel1)
        {
            system.debug('CCCCCCCCCC:'+cCon+'\n');
            string acctid =ApexPages.currentPage().getParameters().get('id');
            List<Level1__c> lvl1obj= new Level1__c[0];
            lvl1obj.add(new Level1__c(Name='Level1',Account__c=acctid,cLevel1__c=cCon.id));
            insert lvl1obj;
    
       
        }  
     }  
     /////////////// LEVEL 2 //////////////
   List<level2s__c> selectLevel2 = new List<level2s__c>();
   List<level2s__c> selectedLevel2 = new List<level2s__c>();
   
   for(Level2sClass con1 : getList2Details(con.lev1))
   
    {
        system.debug('con'+con.selected);
        if(con.selected == true)
        {
            system.debug('secondCCCCCCCCCC:'+con.lev2);
            selectedLevel2.add(con1.lev2);
        }
   
    }   
    Level2__c[] levl2= [Select Id from Level2__c where Account__c=: ApexPages.currentPage().getParameters().get('id')]; 
    delete levl2; 
    if(selectedLevel2 != null)
     { 
      for(level2s__c  cCon : selectedLevel2)
        {
        
         
            system.debug('CCCCCCCCCC:'+cCon+'\n');
            string acctid =ApexPages.currentPage().getParameters().get('id');
            List<Level2__c> lvl2obj= new Level2__c[0];
            lvl2obj.add(new Level2__c(Name='Level2',Account__c=acctid,cLevel2__c=cCon.id));
            insert lvl2obj;
    
        }  
     }  
    
    }
   
 return null;
}

 

 

Hi Dears,

   

   Actually i update list of checkbox fields,some checkbox fields updated and some checkbox field is not updated am getting err.why this happening how to resolve this one.what should i do please can anyone help me...

 

my err line given below and also attach my trigger code:

Trigger LandscapedInTrigger on Level1__c (after insert, after update, before delete) {
    if(trigger.isafter){
    Level1__c[] TCR = trigger.new;
    LandscapedInTriggerHandler.TCRUpdate(TCR);
    }
    if(trigger.isbefore){
    Level1__c[] TCR = trigger.old;
    LandscapedInTriggerHandler.TCRDelete(TCR);
    }
}

 

 

Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Level1Trigger: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0 with id 0017000000V2X4oAAF; first error: STRING_TOO_LONG, Landscape Level 1: data value too large: Administration - Services; Administration - Technology; Other; Traditional Agents - General Brokerage; Traditional Agents - Online Brokerage; Traditional Reinsurers; Traditional Third-Party Administrators (&quot;TPAs&quot;); Traditional Underwriters - General; Traditional Underwriters - Specialty (max length=255): [Landscape_Level_1__c] Class.Level1TriggerHandler.TCRUpdate: line 36, column 1 Trigger.Level1Trigger: line 4, column 1: []...

 

hi,

I am getting err variable does not exist how to resolve this..I put it red mark err line plz help me what should i do..

 

 

public PageReference Save()
{
List<level1s__c> selectLevel1 = new List<level1s__c>();

/////////// LEVEL1 ///////////////////
List<level1s__c> selectedLevel1 = new List<level1s__c>();

for(Level1sClass cCon: getList1Details() )
{
system.debug('cCon'+cCon.selected);
if(cCon.selected == true)
{
system.debug('firstCCCCCCCCCC:'+cCon.lev1);
selectedLevel1.add(cCon.lev1);
}
}

Level1__c[] levl1= [Select Id from Level1__c where Account__c=: ApexPages.currentPage().getParameters().get('id')];
delete levl1;
if(selectedLevel1 != null)
{
for(level1s__c con : selectedLevel1)
{
system.debug('CCCCCCCCCC:'+con+'\n');
string acctid =ApexPages.currentPage().getParameters().get('id');
List<Level1__c> lvl1obj= new Level1__c[0];
lvl1obj.add(new Level1__c(Name='Level1',Account__c=acctid,cLevel1__c=con.id));
insert lvl1obj;

}
}

List<level2s__c> selectedLevel2 = new List<level2s__c>();
for(Level2sClass cCon: getList2Details(cCon.lev1) )
{
system.debug('cCon'+cCon.selected);

if(cCon.selected == true)
{
system.debug('firstCCCCCCCCCC:'+cCon.lev2);
selectedLevel2.add(cCon.lev2);

}
}

Level2__c[] lev2 = [Select Id from Level2__c where Account__c=: ApexPages.currentPage().getParameters().get('id')];
delete levl2;
if(selectedLevel2 != null)
{
for(level2s__c con : selectedLevel2)
{
system.debug('CCCCCCCCCC:'+con+'\n');
string acctid =ApexPages.currentPage().getParameters().get('id');
List<Level2__c> lvl2obj= new Level2__c[0];
lvl2obj.add(new Level2__c(Name='Level2',Account__c=acctid,cLevel2__c=con.id));
insert lvl2obj;

}
}


return null;

}

Hi,

Why this err occr actually i want to pass the parameter where do i write with in metho r other class...

public class kathir_clsLand {

    public Account acct{get; set;}
    public static String accid;
    public static String qryString;
    public static List<Level1s__c> lstLevel1Tree;
    public static List<Level1s__c> lstLevel1;
    public static List<Level2s__c> lstLevel2; 
    public static List<Level3s__c> lstLevel3;
    public static List<Level4s__c> lstLevel4; 
    public String searchinput {get;set;}
    public List<Level1__c> lstsearch {get;set;} 
    public List<Level2__c> lstsearch2 {get;set;} 
    public List<Level3__c> lstsearch3 {get;set;} 
    public List<Level4__c> lstsearch4 {get;set;} 
    public List<Level5__c> lstsearch5 {get;set;} 
    public List<Level6__c> lstsearch6 {get;set;} 
    public String lurl{get;set;}
    public String state{get; set;}
 public String SearchText {get; set;}
 public Level1__c le1;
 
    public ApexPages.StandardController stdController; 
   public kathir_clsLand(ApexPages.StandardController con)
    {
        stdController = con;
        accid = ApexPages.currentPage().getParameters().get('id');
        lurl=ApexPages.currentPage().getParameters().get('levid');
        this.acct = (Account)con.getRecord();
       // this.le1= (Level1__c)con.getRecord();
        system.debug('*********'+acct);
        Integer j; 
        Integer k;
        // lstLevel1Tree = [Select id, name,(select account__r.name from Level1s__r where account__c =:accid ) from Level1s__c where id in (Select cLevel1__c from Level1__c where Account__c=:accid) ]; 
          if(ApexPages.currentPage().getParameters().get('S') == null)
          {
           lstLevel1 = [Select Id, Name,Description__c,(select account__r.name from Level1s__r where account__c =:accid ),(select id, name from Level2s__r limit 1) from level1s__c  order by Name ];
          // lstLevel4 = [Select Id,name,Level3__c,(select id, account__r.name from Level4s__r where account__c =: + accid ) from Level4s__c ];  
          }else
          {
           lstLevel1 = [Select id, name,(select account__r.name from Level1s__r where account__c =:accid ) from Level1s__c where id in (Select cLevel1__c from Level1__c where Account__c=:accid) ];
         //  lstLevel4 = [Select Id,name,Level3__c,(select id, account__r.name from Level4s__r where account__c =: + accid ), (select id from cusLevel5s__r limit 1) from Level4s__c  where id in (Select cLevel4__c from Level4__c where Account__c=:accid) ];  
         } 
         
            if(ApexPages.currentPage().getParameters().get('S') == null)
            {
                Level='All';   
            }
            else
            {
            Level='Selected Only';
            } 
            
            
    }        
    /* search*/
    
    public void searchmethod()
    {
        String url = ApexPages.currentPage().getParameters().get('levid');
        String urls = ApexPages.currentPage().getParameters().get('id');
        if(url != '' && url != null)
        {
            system.debug('$$$$$$$$$$$$$$$$$$$$$$state '+searchinput );
           if(searchinput != null)
           {
           
            lstsearch = [Select Level1__c,Name,cLevel1__r.Name, AccountName__c, Account__c ,cLevel1__c from Level1__c where cLevel1__c=:url   and  AccountName__c LIKE :(searchinput+'%') limit 500];
            lstsearch2 = [Select Level2__c,Name,cLevel2__r.Name, AccountName__c, Account__c ,cLevel2__c from Level2__c where cLevel2__c=:url   and  AccountName__c LIKE :(searchinput+'%') limit 500];
            lstsearch3 = [Select Level3__c,Name,cLevel3__r.Name, AccountName__c, Account__c ,cLevel3__c from Level3__c where cLevel3__c=:url  and  AccountName__c LIKE :(searchinput+'%') limit 500];
            lstsearch4 = [Select Level4__c,Name,cLevel4__r.Name, AccountName__c, Account__c ,cLevel4__c from Level4__c where cLevel4__c=:url   and  AccountName__c LIKE :(searchinput+'%') limit 500];
            lstsearch5 = [Select Level5__c,Name,cLevel5__r.Name, AccountName__c, Account__c ,cLevel5__c from Level5__c where cLevel5__c=:url  and  AccountName__c LIKE :(searchinput+'%') limit 500];
            lstsearch6 = [Select Level6__c,Name,cLevel6__r.Name, AccountName__c, Account__c ,cLevel6__c from Level6__c where cLevel6__c=:url  and  AccountName__c LIKE :(searchinput+'%') limit 500];

            system.debug('****search****'+lstsearch);
           // return lstLevel11 ;
           }
          
        }
    }
    
    /*radio*/
    public List<SelectOption> getItems()
{
   List<SelectOption> options = new List<SelectOption>(); 
   options.add(new SelectOption('All','All')); 
   options.add(new SelectOption('Selected Only','Selected Only'));     
   return options; 
}        
        
public string Level;           
public String getLevel() 
{
return Level;
}
public void setLevel(String Level) 
{ 
this.Level= Level; 
}
/*cuslevel start  */

    public class Level1sClass 
    {
        public String accURL;
        public string acid1{ get; set; }
        public Level1s__c lev1{ get; set; }
        public Level1s__c lev1Tree{ get; set; }
       // public Level1__c lev1AccTree{ get; set; }
        public Level1__c lev1IDTree{ get; set; }
        public List<Level2sClass> lev2 {get; set;}
        public List<Level2sClass> lev2Tree {get; set;}
        public integer chkcountL1 {get; set;} 
        public Boolean selected {get; set;}
        public Level1sClass(Level1s__c gp)
        {
            accURL= ApexPages.currentPage().getParameters().get('id');
            lev1 = gp;
            lev1Tree = gp;
            acid1 = accURL;
        /*    List<Level1__c> treelst1 = [Select Level1__c,Name,CusLevel1Name__c, AccountName__c, Account__c ,cLevel1__c from Level1__c where Account__c=:accURL];
            for(Level1__c le1: treelst1)
            {
             lev1IDTree =  le1;
             
            } */
           
            lev2 = getList2Details(gp); 
          //  lev2Tree = getTreeLevel2list(gp);
           
            if(accURL!= '' && accURL!= null)
            {
                  chkcountL1 = gp.Level1s__r.size();
                    if(chkcountL1  > 0 )
                        {
                            selected = true;
                           
                        }
                        else
                        {
                            selected = false;
                              
                        }
                      
             }  
 
        }
     }       
    public class Level2sClass
    {
        public String accURL;
        public level2s__c lev2 {get; set;}
        public level2s__c lev2Tree {get; set;}
        public Level2__c lev2IDTree{ get; set; }
        public List<Level3sClass> lev3 {get; set;}
        public List<Level3sClass> lev3Tree {get; set;}
        public Boolean selected {get; set;}
        public integer chkcountL2 {get; set;} 
        public Level2sClass(Level2s__c l2)
        {
           accURL= ApexPages.currentPage().getParameters().get('id');
           lev2 = l2;
           lev2Tree = l2;
         /*  List<Level2__c> treelst2 = [Select Level2__c,Name,CusLevel2Name__c, AccountName__c, Account__c ,cLevel2__c from Level2__c where Account__c=:accURL];
            for(Level2__c le1: treelst2)
            {
             lev2IDTree =  le1;
             
            } */
           lev3 = getList3Details(l2);
          // lev3Tree = getTreeLevel3list(l2);
          
           chkcountL2  = l2.Level2s__r.size();
            if(chkcountL2  > 0 )
            {
                selected = true;
               
            }
            else
            {
                selected = false;
                  
            }           
        }
    } 
    public class Level3sClass
    {
        public Level3s__c lev3 {get; set;}
        public Level3__c lev3IDTree{ get; set; }
        public List<Level4sClass> lev4 {get; set;}
        public Boolean selected {get; set;} 
        public integer chkcountL3{get; set;} 
        public Level3sClass(Level3s__c l3)
        {
            lev3 = l3;
          /*     List<Level3__c> treelst3 = [Select Level3__c,Name,CusLevel3Name__c, AccountName__c, Account__c ,cLevel3__c from Level3__c where Account__c=:accid];
            for(Level3__c le1: treelst3 )
            {
             lev3IDTree =  le1;
             
            }  */
            
            lev4 = getList4Details(l3);
            chkcountL3  = l3.Level3s__r.size();
            if(chkcountL3  > 0 )
            {
                selected = true;
               
            }
            else
            {
                selected = false;
                  
            }         
        }
    }
    public class Level4sClass
    {
        public Level4s__c lev4 {get; set;}
        public Boolean selected {get; set;}
        public integer chkcountL4{get; set;}
        public Level4sClass(Level4s__c l4)
        {
            lev4 = l4;
           // lstLevel4 = [Select Id,name,Level3__c,(select id, account__r.name from Level4s__r where account__c =: + accid ) from Level4s__c where Level3__c =:lev4.id limit 1 ]; 
            chkcountL4 = l4.Level4s__r.size();
            if(chkcountL4  > 0 )
            {
                selected = true;
               
            }
            else
            {
                selected = false;
                  
            }      
        }
    }
     List<Level1sClass> Level1List{get; set;}
    public List<Level1sClass> getList1Details()
    {
       if(Level1List == null)
       {       
            Level1List = new List<Level1sClass>();
          
            for(level1s__c k: lstLevel1 )
            { 
                Level1List.add(new Level1sClass(k)); 
            } 
       }     
          
        return  Level1List ;
    }
   
    public static  List<Level2sClass> Level2List; 
    public static List<Level2sClass> getList2Details(Level1s__c lvl) 
    {
          Level2List= new List<Level2sClass>(); 
          if(ApexPages.currentPage().getParameters().get('S') == null)
          {
              lstLevel2 = [Select id,name,Level1_Name__c,Level1__c, (select  id,account__r.name from Level2s__r where account__c =:accid  ) from Level2s__c where Level1__c =:lvl.id order by id]; 
             
          }else
          {
              lstLevel2 = [Select id,name,Level1_Name__c,Level1__c, (select  id,account__r.name from Level2s__r where account__c =:accid  ),(select id from Level3s__r limit 1) from Level2s__c where Level1__c =:lvl.id and id in (Select cLevel2__c from Level2__c where Account__c=:accid) order by id]; 
               
          }
              for(level2s__c s: lstLevel2)
              {
                Level2List.add(new Level2sClass(s));
              }
          
             
         return Level2List;  
    } 
    
    public static  List<Level3sClass> Level3List; 
    public static List<Level3sClass> getList3Details(Level2s__c lvl) 
    {
        Level3List= new List<Level3sClass>();  
        if(ApexPages.currentPage().getParameters().get('S') == null)
          {
               lstLevel3 = [Select Id,name,Description__c,Level2__c,(select id,account__r.name  from Level3s__r where account__c =: accid ),(select id from cusLevel4s__r limit 1)   from Level3s__c where Level2__c =:lvl.id ]; 
          }else
          {
             lstLevel3 = [Select Id,name,Description__c,Level2__c,(select id,account__r.name  from Level3s__r where account__c =: accid ),(select id from cusLevel4s__r limit 1)   from Level3s__c where Level2__c =:lvl.id and id in (Select cLevel3__c from Level3__c where Account__c =: accid) ];  
          }     
                
                 for(level3s__c s: lstLevel3)
                 {
                     Level3List.add(new Level3sClass(s));
                 }  
         
        return Level3List;          
    }
    public static  List<Level4sClass> Level4List; 
    public static List<Level4sClass> getList4Details(Level3s__c lv4) 
    {
        
        Level4List= new List<Level4sClass>(); 
          
             
    
        return Level4List;          
    }
 
/*cuslevel end */

/* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Save $$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */


public PageReference Save()
{
   List<level1s__c> selectLevel1 = new List<level1s__c>();
     
       
    //this.stdController.save();
    

    /////////// LEVEL1 ///////////////////
    List<level1s__c> selectedLevel1 = new List<level1s__c>(); 
    
    for(Level1sClass cCon: getList1Details() )
    {
         system.debug('cCon'+cCon.selected);
        if(cCon.selected == true)
        {
            system.debug('firstCCCCCCCCCC:'+cCon.lev1);
            selectedLevel1.add(cCon.lev1);
        }
    }           
     
    Level1__c[] levl1= [Select Id from Level1__c where Account__c=: ApexPages.currentPage().getParameters().get('id')]; 
    delete levl1; 
    if(selectedLevel1 != null)
    {     
        for(level1s__c con : selectedLevel1)
        {
            system.debug('CCCCCCCCCC:'+con+'\n');
            string acctid =ApexPages.currentPage().getParameters().get('id');
            List<Level1__c> lvl1obj= new  Level1__c[0];
            lvl1obj.add(new Level1__c(Name='Level1',Account__c=acctid,cLevel1__c=con.id));
            insert lvl1obj;
    
        }
    }    
    //////////// LEVEL2 ////////////////////
    List<level2s__c> selectedLevel2 = new List<level2s__c>(); 
    
 
    for(Level2sClass cCon:getList2Details())
    {
    
         system.debug('cCon'+cCon.selected);
        if(cCon.selected == true)
        {
            system.debug('firstCCCCCCCCCC:'+cCon.lev2);
            selectedLevel2.add(cCon.lev2);
        }
    }           
     
    Level2__c[] levl2= [Select Id from Level2__c where Account__c=: ApexPages.currentPage().getParameters().get('id')]; 
    delete levl2; 
    if(selectedLevel2 != null)
    {     
        for(level2s__c con : selectedLevel2)
        {
            system.debug('CCCCCCCCCC:'+con+'\n');
            string acctid =ApexPages.currentPage().getParameters().get('id');
            List<Level2__c> lvl2obj= new  Level2__c[0];
            lvl2obj.add(new Level2__c(Name='Level2',Account__c=acctid,cLevel2__c=con.id));
            insert lvl2obj;
           
         }
    }
  
    return null;
    
}

 

hi dear,

my functionality is When i click the button diff level of record is saved.my err is attempt to dereference a null object.This err when i add return null; with in page reffrnc save() not getting above err but record is not saved here my code below please find why this happen and what should i do...

public PageReference Save()
{
List<level1s__c> selectLevel1 = new List<level1s__c>();

    //this.stdController.save();
    

    /////////// LEVEL1 ///////////////////
   List<level1s__c> selectedLevel1 = new List<level1s__c>(); 
    
    for(Level1sClass cCon: getList1Details())
    {
         system.debug('cCon'+cCon.selected);
        if(cCon.selected == true)
        {
            system.debug('firstCCCCCCCCCC:'+cCon.lev1);
            selectedLevel1.add(cCon.lev1);
        }
    }           
     
    Level1__c[] levl1= [Select Id from Level1__c where Account__c=: ApexPages.currentPage().getParameters().get('id')]; 
    delete levl1; 
    if(selectedLevel1 != null)
    {     
        for(level1s__c con : selectedLevel1)
        {
            system.debug('CCCCCCCCCC:'+con+'\n');
            string acctid =ApexPages.currentPage().getParameters().get('id');
            List<Level1__c> lvl1obj= new  Level1__c[0];
            lvl1obj.add(new Level1__c(Name='Level1',Account__c=acctid,cLevel1__c=con.id));
            insert lvl1obj;
    
        }
    }    
    ///////////////// LEVEL2 //////////////////////
   List<level2s__c> selectedLevel2 = new List<level2s__c>(); 
    
    for(Level2sClass cCon: getList2Details() )
    {
         system.debug('cCon'+cCon.selected);
        if(cCon.selected == true)
        {
            system.debug('firstCCCCCCCCCC:'+cCon.lev2);
            selectedLevel2.add(cCon.lev2);
        }
    }           
     
    Level2__c[] levl2= [Select Id from Level2__c where Account__c=: ApexPages.currentPage().getParameters().get('id')]; 
    delete levl1; 
    if(selectedLevel2 != null)
    {     
        for(level2s__c con : selectedLevel2)
        {
            system.debug('CCCCCCCCCC:'+con+'\n');
            string acctid =ApexPages.currentPage().getParameters().get('id');
            List<Level2__c> lvl2obj= new  Level2__c[0];
            lvl2obj.add(new Level2__c(Name='Level2',Account__c=acctid,cLevel2__c=con.id));
            insert lvl2obj;
    
        }
    }    
  
    return null;
    
}

 

Attempt to de-reference a null object why this err coming.how to resolve this here below my class and VF page code....

please someone help me...

 

controller:

 

public PageReference Save()
{
List<level1s__c> selectLevel1 = new List<level1s__c>();
//this.stdController.save();

/////////// LEVEL1 ///////////////////
List<level1s__c> selectedLevel1 = new List<level1s__c>();

for(Level1sClass cCon: getList1Details() )
{
system.debug('cCon'+cCon.selected);
if(cCon.selected == true)
{
system.debug('firstCCCCCCCCCC:'+cCon.lev1);
selectedLevel1.add(cCon.lev1);
}
}

Level1__c[] levl1= [Select Id from Level1__c where Account__c=: ApexPages.currentPage().getParameters().get('id')];
delete levl1;
if(selectedLevel1 != null)
{
for(level1s__c con : selectedLevel1)
{
system.debug('CCCCCCCCCC:'+con+'\n');
string acctid =ApexPages.currentPage().getParameters().get('id');
List<Level1__c> lvl1obj= new Level1__c[0];
lvl1obj.add(new Level1__c(Name='Level1',Account__c=acctid,cLevel1__c=con.id));
insert lvl1obj;

}
}
///////////////// LEVEL2 //////////////////////
List<level2s__c> selectedLevel2 = new List<level2s__c>();

for(Level2sClass cCon: getList2Details() )
{
system.debug('cCon'+cCon.selected);
if(cCon.selected == true)
{
system.debug('firstCCCCCCCCCC:'+cCon.lev2);
selectedLevel2.add(cCon.lev2);
}
}

Level2__c[] levl2= [Select Id from Level2__c where Account__c=: ApexPages.currentPage().getParameters().get('id')];
delete levl1;
if(selectedLevel2 != null)
{
for(level2s__c con : selectedLevel2)
{
system.debug('CCCCCCCCCC:'+con+'\n');
string acctid =ApexPages.currentPage().getParameters().get('id');
List<Level2__c> lvl2obj= new Level2__c[0];
lvl2obj.add(new Level2__c(Name='Level2',Account__c=acctid,cLevel2__c=con.id));
insert lvl2obj;

}
}

return null;

}

 

 

VF Page:

<body id="classbody">
<apex:form id="form1">
<div class="main_wrapper">
<div class="container-fluid" >
<div class="row-fluid">
<div class="main">
<apex:inputHidden value="{!SearchText}" id="searchTextbox"/>

<div style="background:#fff; margin-left:13px; margin-right:15px; color:#FFF; border-bottom:2px solid #fff;">
<div style="padding-left:40px; padding-bottom:0px;background-image:url('/resource/1382341187000/gradient');"><br/>
<h2 style="color:#333;font-size:18px;">Landscape Details</h2>
<div align="right" style="margin-right:10px;">
<!-- <input type="button" id="btnsave" value="Save" onclick="clntsave();" style="border:0px solid #333; background:#6fb3e0;width:82px; padding:4px; color:#FFF; font-weight:600;border-radius:8px; " />
<input type="button" value="Back To Account" onclick="backtoAccount()" style="border:0px solid #333; background:#6fb3e0;width:142px; padding:4px; color:#FFF; font-weight:600;border-radius:8px; "/> -->
<apex:commandButton action="{!Save}" onclick="clntsave();" style="border:0px solid #333; background:#6fb3e0;width:100px; padding:8px; color:#FFF; font-weight:600;border-radius:16px; " value=" Save "/>
<apex:commandButton onclick="backtoAccount()" style="border:0px solid #333; background:#6fb3e0;width:100px; padding:8px; color:#FFF; font-weight:600;border-radius:16px; " value=" Back To Account"/>
<div style="display:none;" class="msg" id="savemsg">
<br/><b>processing.... </b>
</div>
</div>

<Error is in expression '{!Save}' in component <apex:commandButton> in page kathir_landscape>

 

How to resolve this err please help me any one....

I want to update the record depend upon level1,2,3 like that.given below i put it red mark  this line am gettting Compile Error: Loop variable must be of type why this happen. how to avoid that one please let me know friends... 

 

//// LEVEL1///////////

List<level1s__c> selectedLevel1 = new List<level1s__c>();

for(Level1sClass cCon: getList1Details() )
{
system.debug('cCon'+cCon.selected);
if(cCon.selected == true)
{
system.debug('firstCCCCCCCCCC:'+cCon.lev1);
selectedLevel1.add(cCon.lev1);
}
}

Level1__c[] levl1= [Select Id from Level1__c where Account__c=: ApexPages.currentPage().getParameters().get('id')];
delete levl1;
if(selectedLevel1 != null)
{
for(level1s__c con : selectedLevel1)
{
system.debug('CCCCCCCCCC:'+con+'\n');
string acctid =ApexPages.currentPage().getParameters().get('id');
List<Level1__c> lvl1obj= new Level1__c[0];
lvl1obj.add(new Level1__c(Name='Level1',Account__c=acctid,cLevel1__c=con.id));
insert lvl1obj;

}
}
///////////////// LEVEL2 //////////////////////
// List<level2s__c> selectedLevel2 = new List<level2s__c>();

for(Level2sClass cCon : getList1Details() )
{
system.debug('cCon'+cCon.selected);
if(cCon.selected == true)
{
system.debug('firstCCCCCCCCCC:'+cCon.lev2);
selectedLevel2.add(cCon.lev2);
}
}

Level2__c[] levl2= [Select Id from Level2__c where Account__c=: ApexPages.currentPage().getParameters().get('id')];
delete levl2;
if(selectedLevel2 != null)
{
for(level2s__c cCon : selectedLevel1)
{
system.debug('CCCCCCCCCC:'+cCon +'\n');
string acctid =ApexPages.currentPage().getParameters().get('id');
List<Level2__c> lvl2obj= new Level1__c[0];
lvl1obj.add(new Level2__c(Name='Level2',Account__c=acctid,cLevel2__c=cCon.id));
insert lvl2obj;

}
}

return null;

}

I want to creat clone list of record  for using  unique,can u provide java script code r any other code..

I created a resource to insert an Account record with fields- Name and Description in SF1(say), and i want to send the values from another instance SF2(say) using REST API from URL parameters.

I created one VF page with fields Name and Description. when i entered Name and Description fields respectively they should go to contoller dynamically and create the record in resource instance.

My question is how to pass the values from VF page to Controller(into URL parameters.)?
how to hide standard tabs using vf pages ....?
I am working with list view , after fetching id's i want to access that record using those id's , so what will be query .?

{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")}

var records = {!GETRECORDIDS($ObjectType.student__c)};
Hi,

I am having 2 VF pages which shares the same controller

I want to consolidate these 2 VF page into a single one , Please help me how to do it


VF PAGE 1 :

<apex:page controller="AF_AccountExtension">
   <apex:form >
    <apex:pageMessages >
    </apex:pageMessages>

    <apex:pageBlock id="exRepTable">
        <apex:pageBlockTable value="{!exMyRepList}"  var="exRep">
          <apex:column headerValue="Action">
                <apex:commandLink target="_blank" value="Generate Report" action="{!generateReport}" styleClass="btn" style="color:Black;text-decoration:none">
                    <apex:param name="repLink" value="{!exRep.Report_Link__c}" assignTo="{!repLink}"/>
                    <apex:param name="acPDN" value="{!accnt.Ally_Primary_Dealer_Number__c}" assignTo="{!acPDN}"/>
                    <apex:param name="repName" value="{!exRep.Id}" assignTo="{!repName}"/>
                    <apex:param name="storageLocation" value="{!exRep.Storage_Location__c}" assignTo="{!storageLocation}"/>
                    <apex:param name="FileName" value="{!exRep.FileNameFilter__c}" assignTo="{!fileNameFilter}"/>
                    <apex:param name="extension" value="{!exRep.FileName_Extension__c}" assignTo="{!fileNameExtension}"/>
                </apex:commandLink>
            </apex:column>
          
            <apex:column headerValue="Name">
                <apex:outputLink value="/{!exRep.Id}" target="_blank">{!exRep.Name}</apex:outputLink>
            </apex:column>
            <apex:column headerValue="Report Description" value="{!exRep.Short_Description__c}"/>
            <apex:column headerValue="Primary Contact" value="{!exRep.Primary_Contact__c}"/>


        </apex:pageBlockTable>
      
      
    </apex:pageBlock>
</apex:form>
</apex:page>

VF PAGE 2 :

<apex:page controller="AF_AccountExtension">
   <apex:form >
    <apex:pageMessages >
    </apex:pageMessages>

    <apex:pageBlock id="exRepTable">
        <apex:pageBlockTable value="{!exPivotRepList}" var="exRep">
          <apex:column headerValue="Action">
                <apex:commandLink target="_blank" value="Generate Report" action="{!generateReport}" styleClass="btn" style="color:Black;text-decoration:none">
                    <apex:param name="repLink" value="{!exRep.Report_Link__c}" assignTo="{!repLink}"/>
                    <apex:param name="acPDN" value="{!accnt.Ally_Primary_Dealer_Number__c}" assignTo="{!acPDN}"/>
                    <apex:param name="repName" value="{!exRep.Id}" assignTo="{!repName}"/>
                    <apex:param name="storageLocation" value="{!exRep.Storage_Location__c}" assignTo="{!storageLocation}"/>
                    <apex:param name="FileName" value="{!exRep.FileNameFilter__c}" assignTo="{!fileNameFilter}"/>
                    <apex:param name="extension" value="{!exRep.FileName_Extension__c}" assignTo="{!fileNameExtension}"/>
                </apex:commandLink>
            </apex:column>
          
            <apex:column headerValue="Name">
                <apex:outputLink value="/{!exRep.Id}" target="_blank">{!exRep.Name}</apex:outputLink>
            </apex:column>
            <apex:column headerValue="Report Description" value="{!exRep.Short_Description__c}"/>
            <apex:column headerValue="Primary Contact" value="{!exRep.Primary_Contact__c}"/>

        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>
</apex:page>

Those 2 highlighted lists are used in my controller


Please help me how to combine those 2 to one, so that if i click on the link related to 1st list only th e 1st list to be displayed not the second one

Thanks in advance
Hi folks 
     My developer console doesnt work properly..It shows like
User-added image

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.
 

In a standard salesforce pages there is a way to filter/Sort the list based on staring Letter. This is precisely the requirement which was required to be built for custom visualforce page. I built a page and class which would do this functionality

 

click here to check the visualforce page and the controller to built the list