• sk kumar
  • NEWBIE
  • 60 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 13
    Replies

vfpage-----


<apex:page Controller="Employee" showheader="false">
  <apex:form >
   <script type='text/javascript'>
   function runOnEnter(ev) {
        if (window.event && window.event.keyCode == 13 || ev.which == 13) {
            searchEmpRecs();
            return false;
        } else {
            return true;
        }
}
</script>
 <apex:inputText value="{!searchString}" onkeypress="return runOnEnter(event);"/>
  <apex:commandButton value="Submit" action="{!searchEmp}" reRender="pgblcktbl"/>
    <apex:pageBlock title="Employee Details">
     <apex:pageBlockTable value="{!empList}" var="emp" id="pgblcktbl">
        <apex:column value="{!emp.First_Name__c}"/>
           <apex:column value="{!emp.Last_Name__c}"/>
             <apex:column value="{!emp.EmpID__c}"/>
               <apex:column value="{!emp.Email__c  }"/>
                 <apex:column value="{!emp.contact__c}"/>
                <apex:column value="{!emp.cityy__c}"/>
               <apex:column value="{!emp.Address__c}"/>
             <apex:column value="{!emp.Department__c}"/>
        </apex:pageBlockTable>
        </apex:pageBlock>
      <apex:actionFunction name="searchEmpRecs" action="{!searchEmp}" reRender="pgblcktbl"/>
  </apex:form>
</apex:page>

class---------

public class Employee {

    public Employee() {
        empList = new List<Employees__c>();
        empList = [select id,First_Name__c,Last_Name__c,EmpID__c,Email__c,Department__c,contact__c,cityy__c,Address__c from Employees__c];
    }
   
    Public List<Employees__c> empList{get;set;}
    Public string searchString{get;set;}


   Public void searchEmp(){
        searchString += '%';
        empList = new List<Employees__c>();
        empList = [select First_Name__c,Last_Name__c,EmpID__c,Email__c,contact__c,cityy__c,Department__c,Address__c from Employees__c where First_Name__c like : searchString limit 10];
       
    }   
 }


 
so basically its like a nested manner related to each other..so  i m putting my code over here..anyone kindly suggest or modify my code as for the given require ments..its urgent plz reply,,,!!

thnx in advance..:)

vf page---


<apex:page standardController="Account" extensions="productconfig6" sidebar="false" showHeader="false" standardStylesheets="true" > 
    <apex:form >
      <apex:pageblock >
        <apex:panelGrid columns="1" style="float:left;">
         Select Node&nbsp;&nbsp;&nbsp; <apex:selectList size="1" value="{!SelectedNode}">
                 <apex:selectOptions value="{!SelectedNodes}"/>
                      <apex:actionSupport event="onchange" reRender="a"/>
                      </apex:selectList>
                      <br></br><br></br>
                Select Product &nbsp;&nbsp;<apex:selectList size="1" value="{!product}" id="a">
               <apex:selectOptions value="{!products}"/>
                       <apex:actionSupport event="onclick" reRender="Details" action="{!productDetails}"/>
                    </apex:selectList>
                 </apex:panelGrid>
               <apex:outputPanel id="Details">
             <apex:detail subject="{!pList.id}"/>
          </apex:outputPanel>
        </apex:pageblock>
      </apex:form>
   </apex:page>

controller-----

public with sharing class productconfig6
  {
       Public String SelectedNode{get;set;}
       Public String Product{get;set;}
      
       Public String SelectedProduct{get;set;}
       public product2 pList {get; set;}
       
          public productconfig6(ApexPages.StandardController controller){
          
         }
     public List<SelectOption> getSelectedNodes()
      {
         List<SelectOption> options = new List<SelectOption>();
         options.add(new SelectOption('None','--- None ---'));      
         options.add(new SelectOption('N1','N1'));
         options.add(new SelectOption('N2','N2'));
         options.add(new SelectOption('N3','N3'));      
         return options;
      }
      
      public List<SelectOption> getProducts()
     {
          List<SelectOption> options = new List<SelectOption>();
          if(SelectedNode == 'N1')
         {     
              options.add(new SelectOption('CPU','CPU'));
             options.add(new SelectOption('MOUSE','MOUSE'));
         }
          else if(SelectedNode == 'N2')
         {     
             options.add(new SelectOption('N/W','N/W'));
             options.add(new SelectOption('network','network'));
             
          }
          else if(SelectedNode == 'N3')
        {     
             options.add(new SelectOption('MONITOR','MONITOR'));
            
         }
          else
          {
             options.add(new SelectOption('None','--- None ---'));
          }    
         return options;
      }     
  
  public List<String> productDetails()
     {
    
   pList= [select id,name FROM product2 where name=:product limit 1];
        return null;
    }
}
<apex:page standardController="Account" extensions="productconfig5">
    <apex:form >
       <apex:pageblock >
          <apex:panelGrid columns="5">
             Select Node &nbsp;<apex:selectList size="1" value="{!SelectedNode}">
               <apex:selectOptions value="{!SelectedNodes}"/>
                  <apex:actionSupport event="onchange" reRender="a"/>
                     </apex:selectList>   
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select Product &nbsp;<apex:selectList size="1" value="{!product}" id="a">
                            <apex:selectOptions value="{!products}"/>
                         <apex:actionSupport event="onclick" reRender="Details"/>
                       </apex:selectList>
                     </apex:panelGrid>
                   <apex:outputPanel id="Details">
                <apex:outputText value="The Product you Selected is {!product} " rendered="{!product != null}" />
             </apex:outputPanel>
          </apex:pageblock>
      </apex:form>
</apex:page>

class--

public with sharing class productconfig5
{
      Public String SelectedNode{get;set;}
      Public String Product{get;set;}
      Public String SelectedProduct{get;set;}
      public productconfig5(ApexPages.StandardController controller)
         {
       
        }
  
    public List<SelectOption> getSelectedNodes()
    {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('None',' None'));       
        options.add(new SelectOption('N1','N1'));
        options.add(new SelectOption('N2','N2'));
        options.add(new SelectOption('N3','N3'));       
        return options;
    }
    public List<SelectOption> getProducts()
    {
        List<SelectOption> options =new List<SelectOption>();
        if(SelectedNode == 'N1')
        {      
            options.add(new SelectOption('CPU','CPU'));
            options.add(new SelectOption('MOUSE','MOUSE'));
        }
        else if(SelectedNode == 'N2')
        {      
            options.add(new SelectOption('N/W','N/W'));
          
        }
        else if(SelectedNode == 'N3')
        {      
            options.add(new SelectOption('MONITOR','MONITOR'));
          
        }
        else
        {
            options.add(new SelectOption('None', 'None '));
        }     
        return options;
   }      
}
vfpage-

<apex:page standardController="Account" extensions="productconfig1">
  <apex:form >
  
   <apex:pageblock >
           <apex:panelGrid columns="5">
            Select Node &nbsp;<apex:selectList size="1" value="{!SelectedNode}">
                   <apex:selectOptions value="{!SelectedNodes}"/>
                  <apex:actionSupport event="onchange" reRender="a"/>
              </apex:selectList> 
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select Product &nbsp;<apex:selectList size="1" value="{!product}" id="a">
                   <apex:selectOptions value="{!products}"/>
                   <apex:actionSupport event="onclick" reRender="Details"/>
                 </apex:selectList>
         </apex:panelGrid>
         <apex:outputPanel id="Details">
             <apex:outputText value="The Product you Selected is {!product} " rendered="{!product != null}" />
         </apex:outputPanel>
      </apex:pageblock>
    
    </apex:form>

</apex:page>


Controller--

public with sharing class productconfig1
{
      Public String SelectedNode{get;set;}
     Public String Product{get;set;}
      Public String SelectedProduct{get;set;}
      
         public productconfig1(ApexPages.StandardController controller){
       
        }

  
     public List<SelectOption> getSelectedNodes()
   {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('None','--- None ---'));     
        options.add(new SelectOption('N1','N1'));
        options.add(new SelectOption('N2','N2'));
        options.add(new SelectOption('N3','N3'));     
        return options;
    }
  
    public List<SelectOption> getProducts()
    {
      List<SelectOption> options = new List<SelectOption>();
      if(SelectedNode == 'N1')
      {    
          options.add(new SelectOption('CPU','CPU'));
            options.add(new SelectOption('MOUSE','MOUSE'));
        }
        else if(SelectedNode == 'N2')
      {    
            options.add(new SelectOption('N/W','N/W'));
         
        }
       else if(SelectedNode == 'N3')
       {    
           options.add(new SelectOption('MONITOR','MONITOR'));
        
       }
       else
       {
             options.add(new SelectOption('None','--- None ---'));
        }   
        return options;
     }    

    }
<apex:page standardController="Account" extensions="productconfig1">
  <apex:form >
      <apex:pageblock >
          <apex:panelGrid columns="5">
             Select Node &nbsp;<apex:selectList value="{!SelectedNode}" multiselect="false" size="1">
                <apex:selectOption itemValue="N1" itemLabel="N1"/>
                   <apex:selectOption itemValue="N2" itemLabel="N2"/>
                      <apex:selectOption itemValue="N3" itemLabel="N4"/>
                     </apex:selectList>
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select Product &nbsp;<apex:selectList value="{!SelectedProduct}" multiselect="false" size="1">
              <apex:selectOptions value="{!Product}"/>
           </apex:selectList>
        </apex:panelGrid>
     </apex:pageblock>
  </apex:form>
</apex:page>

classs---

public with sharing class productconfig1
{
Public String SelectedNode{get;set;}
Public String SelectedProduct{get;set;}
public productconfig1(ApexPages.StandardController controller)
{

    }
   
    public List<SelectOption> getProduct() {
        List<SelectOption> ProductOptions = new List<SelectOption>();
        ProductOptions.add(new SelectOption('CPU','CPU'));
        ProductOptions.add(new SelectOption('N/W','N/W'));
        ProductOptions.add(new SelectOption('MONITOR','MONITOR'));

        return ProductOptions ;
    }
}
i hav a requirement in vf page. there is nod called car is there.if i click car it will show different brand of cars like x,y,z.if i click x car it will show all its features like engine model, power etc next to the x car node. then if i select engine of x car then it will show the engine details next to that.so its like nested kind of scenario.so any one plz help me out or provide me code for this..how to achieve this requirement,

thnx in advance..:)
is it possible to do insert operation inside a constructor..plz suggest
my requirement is like i want to see 2000 records in single page.how can i achieve this. anyone plz suggest.
thanx in advance..:)

i hav created a custom report for a specific profile which is having 20 user.  but i want out of 4 user will able to see my custom report..then what should i do..plz reply

thnx in advance
my scenario is like..i hav created a custom report for specific profile which is consits of 10 user. but out of 10 user 3 user some how will not able to see my custom report..so can any one tell me what is the reason for that...and also what should i do the changes to visble my custom report to these 3 user..!!

thanx in advance..:)
trigger recursive on job_aplicationn__c (after insert,after update)
{
if(trigger.isinsert)
{
list<job_aplicationn__c >jobapplist=new list<job_aplicationn__c >();
   {
for(job_aplicationn__c ja:trigger.new)
   {
  jobapplist.add(ja);
   }
recursive trigger.method(jobapplist);
{
if(trigger.isinsert)
{
list<job_aplicationn__c >jobapplist=new list<job_aplicationn__c >
   {
for(job_aplicationn__c ja:trigger.new)
   {
  jobapplist.add(ja);
   }
recursive trigger.method(jobapplist);
  {
  if(trigger.isupdate)
  {
  list<job_aplicationn__c >jobapplist=new list<job_aplicationn__c >
  {
   for(job_aplicationn__c ja.trigger.new)
   {
    job_aplicationn__c jobappold=trigger.oldmap.get(ja.id);
    job_aplicationn__c jobappnew=trigger.newmap.get(ja.id);
    double billratenew=jobappold.bil_rate__c;
    double billrateold=jobappnew.bil_rate__c;
    if(billratenew!=billrateold)
    {
   jobapplist.add(ja);
    }
   }
   recursive trigger.method(jobapplist);
   }
   public class recursive trigger
   {
    public static void method(list<job_aplicationn__c >jobapplist){
    set<id>ids=new set<id>();
    for(job_aplicationn__c ja:jobapplist)
      {
     ids.add(ja.id);
       }
   list<job_aplicationn__c >jalist=[select id,bil_rate__c from job_aplicationn__c where id in:ids ];
   for(job_aplicationn__c j:jalist)
   {
   j.bil_rate__c =100;
   }
   update jalist;
   }
  }
  );
  {
  if(trigger.isupdate)
  {
  list<job_aplicationn__c >jobapplist=new list<job_aplicationn__c >();
  {
   for(job_aplicationn__c ja.trigger.new)
   {
    job_aplicationn__c jobappold=trigger.oldmap.get(ja.id);
    job_aplicationn__c jobappnew=trigger.newmap.get(ja.id);
    double billratenew=jobappold.bil_rate__c;
    double billrateold=jobappnew.bil_rate__c;
    if(billratenew!=billrateold)
    {
   jobapplist.add(ja);
    }
   }
   recursive trigger.method(jobapplist);
   }
   public class recursive trigger
   {
    public static void method(list<job_aplicationn__c >jobapplist)
    {
    set<id>ids=new set<id>();
    for(job_aplicationn__c ja:jobapplist)
      {
     ids.add(ja.id);
       }
   list<job_aplicationn__c >jalist=[select id,bil_rate__c from job_aplicationn__c where id in:ids ];
   for(job_aplicationn__c j:jalist)
   {
   j.bil_rate__c =100;
   }
   update jalist;
   }
  }


m getting an error called ==   Error Error: Compile Error: Illegal variable declaration: trigger.method at line 11 column 12



anyone plz help me out..!!!!

vfpage-----


<apex:page Controller="Employee" showheader="false">
  <apex:form >
   <script type='text/javascript'>
   function runOnEnter(ev) {
        if (window.event && window.event.keyCode == 13 || ev.which == 13) {
            searchEmpRecs();
            return false;
        } else {
            return true;
        }
}
</script>
 <apex:inputText value="{!searchString}" onkeypress="return runOnEnter(event);"/>
  <apex:commandButton value="Submit" action="{!searchEmp}" reRender="pgblcktbl"/>
    <apex:pageBlock title="Employee Details">
     <apex:pageBlockTable value="{!empList}" var="emp" id="pgblcktbl">
        <apex:column value="{!emp.First_Name__c}"/>
           <apex:column value="{!emp.Last_Name__c}"/>
             <apex:column value="{!emp.EmpID__c}"/>
               <apex:column value="{!emp.Email__c  }"/>
                 <apex:column value="{!emp.contact__c}"/>
                <apex:column value="{!emp.cityy__c}"/>
               <apex:column value="{!emp.Address__c}"/>
             <apex:column value="{!emp.Department__c}"/>
        </apex:pageBlockTable>
        </apex:pageBlock>
      <apex:actionFunction name="searchEmpRecs" action="{!searchEmp}" reRender="pgblcktbl"/>
  </apex:form>
</apex:page>

class---------

public class Employee {

    public Employee() {
        empList = new List<Employees__c>();
        empList = [select id,First_Name__c,Last_Name__c,EmpID__c,Email__c,Department__c,contact__c,cityy__c,Address__c from Employees__c];
    }
   
    Public List<Employees__c> empList{get;set;}
    Public string searchString{get;set;}


   Public void searchEmp(){
        searchString += '%';
        empList = new List<Employees__c>();
        empList = [select First_Name__c,Last_Name__c,EmpID__c,Email__c,contact__c,cityy__c,Department__c,Address__c from Employees__c where First_Name__c like : searchString limit 10];
       
    }   
 }


 
<apex:page standardController="Account" extensions="productconfig5">
    <apex:form >
       <apex:pageblock >
          <apex:panelGrid columns="5">
             Select Node &nbsp;<apex:selectList size="1" value="{!SelectedNode}">
               <apex:selectOptions value="{!SelectedNodes}"/>
                  <apex:actionSupport event="onchange" reRender="a"/>
                     </apex:selectList>   
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select Product &nbsp;<apex:selectList size="1" value="{!product}" id="a">
                            <apex:selectOptions value="{!products}"/>
                         <apex:actionSupport event="onclick" reRender="Details"/>
                       </apex:selectList>
                     </apex:panelGrid>
                   <apex:outputPanel id="Details">
                <apex:outputText value="The Product you Selected is {!product} " rendered="{!product != null}" />
             </apex:outputPanel>
          </apex:pageblock>
      </apex:form>
</apex:page>

class--

public with sharing class productconfig5
{
      Public String SelectedNode{get;set;}
      Public String Product{get;set;}
      Public String SelectedProduct{get;set;}
      public productconfig5(ApexPages.StandardController controller)
         {
       
        }
  
    public List<SelectOption> getSelectedNodes()
    {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('None',' None'));       
        options.add(new SelectOption('N1','N1'));
        options.add(new SelectOption('N2','N2'));
        options.add(new SelectOption('N3','N3'));       
        return options;
    }
    public List<SelectOption> getProducts()
    {
        List<SelectOption> options =new List<SelectOption>();
        if(SelectedNode == 'N1')
        {      
            options.add(new SelectOption('CPU','CPU'));
            options.add(new SelectOption('MOUSE','MOUSE'));
        }
        else if(SelectedNode == 'N2')
        {      
            options.add(new SelectOption('N/W','N/W'));
          
        }
        else if(SelectedNode == 'N3')
        {      
            options.add(new SelectOption('MONITOR','MONITOR'));
          
        }
        else
        {
            options.add(new SelectOption('None', 'None '));
        }     
        return options;
   }      
}
<apex:page standardController="Account" extensions="productconfig1">
  <apex:form >
      <apex:pageblock >
          <apex:panelGrid columns="5">
             Select Node &nbsp;<apex:selectList value="{!SelectedNode}" multiselect="false" size="1">
                <apex:selectOption itemValue="N1" itemLabel="N1"/>
                   <apex:selectOption itemValue="N2" itemLabel="N2"/>
                      <apex:selectOption itemValue="N3" itemLabel="N4"/>
                     </apex:selectList>
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select Product &nbsp;<apex:selectList value="{!SelectedProduct}" multiselect="false" size="1">
              <apex:selectOptions value="{!Product}"/>
           </apex:selectList>
        </apex:panelGrid>
     </apex:pageblock>
  </apex:form>
</apex:page>

classs---

public with sharing class productconfig1
{
Public String SelectedNode{get;set;}
Public String SelectedProduct{get;set;}
public productconfig1(ApexPages.StandardController controller)
{

    }
   
    public List<SelectOption> getProduct() {
        List<SelectOption> ProductOptions = new List<SelectOption>();
        ProductOptions.add(new SelectOption('CPU','CPU'));
        ProductOptions.add(new SelectOption('N/W','N/W'));
        ProductOptions.add(new SelectOption('MONITOR','MONITOR'));

        return ProductOptions ;
    }
}
my scenario is like..i hav created a custom report for specific profile which is consits of 10 user. but out of 10 user 3 user some how will not able to see my custom report..so can any one tell me what is the reason for that...and also what should i do the changes to visble my custom report to these 3 user..!!

thanx in advance..:)