• naveen reddy 68
  • NEWBIE
  • 60 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 1
    Replies
I have created a visual force page  with two tabs for the same object fields.
when i click on the button it must go to second tabs.

Here is my code:

<apex:page standardController="product_Development__c" extensions="HistoryPageController">
<apex:form >

<apex:pageblock title="VF Page Tabs" >
<apex:tabPanel id="theTabPanel" value="{!tabOpt}" >
<apex:tab label="Basic Info">
<b>Name:</b><apex:inputField value="{!product_Development__c.name}"/><br/>
<b>closed Date:</b>
<apex:inputField value="{!product_Development__c.Policy_Name__c}"/>
<br/>
<b>Education Requirement:</b><apex:inputField value="{!product_Development__c.Policy_Name__c}"/><br/>
<apex:commandButton value="Go to Two" action="{!switch}" rerender="theTabPanel"/>
</apex:tab>
<apex:tab label="DetailPage">
<b>Apex:</b><apex:inputField value="{!product_Development__c.product_Id__c  }"/><br/>
<b>Max_Pay:</b>
<apex:inputField value="{!product_Development__c.product_Id__c}"/>
<br/>
<b>Min_Payt:</b><apex:inputField value="{!product_Development__c.product_Id__c}"/><br/>
</apex:tab>
</apex:tabPanel>
</apex:pageblock>
  </apex:form>

</apex:page>

apex class:
public class HistoryPageController
{
    public String tabOpt {get;set;}
    private ApexPages.StandardController controller;

    public HistoryPageController(ApexPages.StandardController controller)
    {
    this.controller = controller;
    }
      
    
    public void switch()
    {
        tabOpt = 'DetailPage';
    }
}
 here the button is created and it not switching the second  tab.
Please help me.
I want to enter the product quantity field value from my visualforce page.
How i achieve this, using visual force page.
please help me.
In my visual force page i have two links .
1) when click on the link it color should be changed.when i click on the other link it should be same color.
here is my code
<apex:page >
<apex:form >

<apex:outputLink value="https://c.ap7.visual.force.com/apex/samepage" target="theIframe" styleClass="MyLinks">Click me!</apex:outputLink><br>
<apex:outputLink value="https://ap7.salesforce.com/06628000008FTBh">Visualforce!</apex:outputLink></br>

</apex:form>
</apex:page>
I want to give access of my visualforce page, Who doesnot have salesforce loginID. he has to access through  site
how can i  achive this,please help me regarding this
I want to give access of my visualforce page, Who doesnot have salesforce loginID.
how can i  achive this,please help me regarding this
I have 2 objects product(parent object) and price(child object) and the  relationship is lookup .
I have a field amount in child object and i want  the sum of  amont field  like Roll-up summery field.
How can i get this.
I have a create 3 tasks t1,t2&t3 in this i have a number field in the task i want to calculate sum of the tree  fields.
can some one help me, how can i get this
 
I have created a check box on the contact object,when ever i create a new record on contact the previous record checkbox field must be unchecked automatically
could some one help me ,how to write a trigger
trigger NumOfContacts on contact (after insert, after update, after delete, after undelete) 
{
    
    List<account> acc = new List<account>();
    
    Set<Id> sid = new Set<Id>();
    
    if(Trigger.isDelete) 
    {
        for(contact con:Trigger.Old) 
        {
            sid.add(con.accountId);   
        }    
    }
    else
        if(Trigger.isUpdate) 
    {
        
        for(contact con:Trigger.New) 
        {            
            sid.add(con.accountId);   
        }
        
        for(contact con:Trigger.Old)
        {
            sid.add(con.accountId);   
        }   
    }
    
    else
    {
        for(contact con:Trigger.New) 
        {
            sid.add(con.accountId);   
        }
    }
    
    AggregateResult[] groupedResults = [SELECT COUNT(Id),accountId FROM contact where accountID IN :sid GROUP BY accountID ];
    
    for(AggregateResult ar:groupedResults) 
    {
        
        Id custid = (ID)ar.get('accountId');
        
        Integer count = (INTEGER)ar.get('expr0');
        
        account cust1 = new account(Id=custid);
        
        cust1.No_Of_Contacts__c = count;
        
        acc.add(cust1);
        
    }
    
    
    update acc;
    
}
public class sample1 {
    
   Public static boolean x = True;

}


trigger calculation on calculation__c (before insert,before update) 
{
    list<calculation__c> cal1 = new list<calculation__c>();
    if( sample1.x)
    {
        sample1.x = false;
        for(calculation__c cal:trigger.new)
        {
            integer intDays =  cal.Open_date__c.daysBetween(cal.closed_date__c);
            system.debug(intDays);
            if(intDays!=0)
            {
                for(integer i=1;i<=intDays;i++)
                {
                    
                    calculation__c c = new calculation__c(customer_Name__c = 'Naveen' + i);
                    cal1.add(c);
                }
            }
        }
    }
}
 In this program the for loop is not working
trigger calculation on calculation__c (before insert,before update) 
{
  list<calculation__c>cal1=new list<calculation__c>();
    for(calculation__c cal:trigger.new)
    { 
        
        integer intDays =  cal.Open_date__c.daysBetween(cal.closed_date__c);
       system.debug(intDays);
      if(intDays!=null)
        {
          
              
        for(integer i=1;i<=intDays;i++)
        {
           
           for(calculation__c cl:trigger.new)
           {                    
               if(trigger.isInsert)
               {
                cal.customer_Name__c='naveen';
                   cal1.add(cal); 
               }
                //insert cal1;
               
               
          }
        }
        }    
       }
    }
When i have workfloew and Process builder for field updates, why should i use apex tirggers for field updates? 
My sceniro is,When i submit record for Approval, If first person doesnot react on this submission with in 24hrs it sholud go to the second person how can i achive this?
I need to query new records after inserting a record but my below trigger doesnt show any error but even doesnt display any records either please suggest me


trigger con1 on Contact (before insert,before update) 
{
    Map<id,Name> MP = new Map<id,Name>();
    for(Contact con:Trigger.new)
    {
        if(con.LastName != null)
        {
            con.Title = 'kelly1';
            
        }
        if(con.Title == 'kelly1')
            {
            list<contact> c1=[select id,lastName From Contact where id=:trigger.NewMap.keyset()];
            system.debug(c1);
            }
    }
    
    
}
I have created a visual force page  with two tabs for the same object fields.
when i click on the button it must go to second tabs.

Here is my code:

<apex:page standardController="product_Development__c" extensions="HistoryPageController">
<apex:form >

<apex:pageblock title="VF Page Tabs" >
<apex:tabPanel id="theTabPanel" value="{!tabOpt}" >
<apex:tab label="Basic Info">
<b>Name:</b><apex:inputField value="{!product_Development__c.name}"/><br/>
<b>closed Date:</b>
<apex:inputField value="{!product_Development__c.Policy_Name__c}"/>
<br/>
<b>Education Requirement:</b><apex:inputField value="{!product_Development__c.Policy_Name__c}"/><br/>
<apex:commandButton value="Go to Two" action="{!switch}" rerender="theTabPanel"/>
</apex:tab>
<apex:tab label="DetailPage">
<b>Apex:</b><apex:inputField value="{!product_Development__c.product_Id__c  }"/><br/>
<b>Max_Pay:</b>
<apex:inputField value="{!product_Development__c.product_Id__c}"/>
<br/>
<b>Min_Payt:</b><apex:inputField value="{!product_Development__c.product_Id__c}"/><br/>
</apex:tab>
</apex:tabPanel>
</apex:pageblock>
  </apex:form>

</apex:page>

apex class:
public class HistoryPageController
{
    public String tabOpt {get;set;}
    private ApexPages.StandardController controller;

    public HistoryPageController(ApexPages.StandardController controller)
    {
    this.controller = controller;
    }
      
    
    public void switch()
    {
        tabOpt = 'DetailPage';
    }
}
 here the button is created and it not switching the second  tab.
Please help me.