• PuranKishore
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 5
    Replies

 i want to pratice can any body give me some task to practice to improve my skills

public class AllAccountEx1_Controller
{
    public AllAccountEx1_Controller()
    {
        acct = new Account();
        
        accontblock=true;
    }
 
    public Account acct{set;get;}
    public Account getAcc()
    {
        return acct;
    }
    public list<Account> lst = new list<Account>();
    public list<Account> getAccounts()
    {
        lst = [Select Name,Site,BillingStreet,BillingCity,BillingState,Billingpostalcode,Billingcountry,Phone,Type,OwnerId, Account_Email__c from Account limit 100];
        
        return lst;
    }
    
    public boolean accountedit{set;get;}
    public boolean accontblock{set;get;}
    public pagereference onClick()
    {
        string idval = apexpages.currentpage().getparameters().get('accid');
        pagereference ref = new pagereference('/'+idval);
        return ref;
        
    }
    public account ac{set;get;}
    public pagereference Edit()
    {
        string selectedid=apexpages.currentpage().getparameters().get('acid');
        ac=[select id,name,Annualrevenue,Accountnumber from account where id=:selectedid];
        accountedit=true;
        accontblock=false;
    return null;
    }
    
    public void Del()
    {
       
       string selectedid=apexpages.currentpage().getparameters().get('accountid');
        account ac=[select id,name,Annualrevenue,Accountnumber from account where id=:selectedid];
        delete ac;
       
    }
    
    public void cancel()
    {
        
       
        //pagereference ref1 = new pagereference(acct.view());
        accountedit=false;
        accontblock=true;
        //return ref1;
    }
    public void getSave()
    {
              //string selectedid=apexpages.currentpage().getparameters().get('acid');
              
          // Account   acc1 = new Account();
              //acc1=[select id,name,Annualrevenue,Accountnumber from account where id=:selectedid];
                update ac;
                accountedit=false;
                accontblock=true;
        
    }
}

<apex:page controller="wrapperexample_controller" sidebar="false">
    <apex:form >
        <apex:pageBlock id="b">
            <apex:pageBlockTable value="{!listvalues}" var="lv">
                <apex:column value="{!lv.Id}"/>
                <apex:column value="{!lv.Name}"/>
                <apex:column value="{!lv.Email}"/>
                <apex:column value="{!lv.Phone}"/>
            </apex:pageBlockTable>
            
        <apex:commandLink value="NextPage" action="{!Next}" reRender="b"/>
        <apex:commandLink value="PreviousPage" action="{!Previous}" reRender="b"/>
        <apex:commandLink value="FirstPage" action="{!First}" reRender="b"/>
        <apex:commandLink value="LastPage" action="{!Last}" reRender="b"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

 

 

 

public class wrapperexample_controller
{
    public wrapperexample_controller()
    {
        /* for(Contact c:[select Id, Name, Phone, Email from Contact])
        {
            wrapper w = new wrapper();
            w.Id = c.Id;
            w.Name = c.Name;
            w.Phone = c.Phone;
            w.Email = c.Email;
            lst.add(w);
        } */
    }
    public apexpages.standardsetcontroller con
    {
        get
        {
            if(con == Null)
            {
                con = new ApexPages.standardsetcontroller(Database.getQueryLocator([Select Id, Name, Phone, Email from Contact Order By LastName limit 100]));
                con.setpagesize(10);
            }
            return con;
        }
    }
    
    
    public list<Contact> lst = new list<Contact>();
    
   
    public list<Contact> getlistvalues()
    {
         for( Contact ct:(list<Contact>)con.getrecords())
         {
             lst.add(ct);
         }
       
        return lst;
    }
        
    public class wrapper
    {
        public String Id{set;get;}
        public String Name{set;get;}
        public String email{set;get;}
        public String Phone{set;get;}
    }
    public void next()
    {
        con.next();
    }
    public void previous()
    {
        con.previous();
    }
    public void first()
    {
        con.first();
    }
    public void last()
    {
        con.last();
    }
    public Boolean hasNext {
        get {
            return con.getHasNext();
        }
        set;
    }
    public Boolean hasPrevious {
        get {
            return con.getHasPrevious();
        }
        set;
    }
}

 when we r in first page i must find only next, last pages in last page i must find only previous and first page

 method i had created an object of email service


global class CaptureEmail implements Messaging.InboundEmailHandler
{
 
  global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email,
    Messaging.InboundEnvelope env)
    {
 
    Messaging.InboundEmailResult res = new Messaging.InboundEmailresult();
   
    Email_Object_Simple__c ema = new Email_Object_Simple__c();
    
    for(integer i=1;i<=50001;i++)
    {
    ema.Name__c= email.fromname;
    //ema.LastName = email.fromname;
    ema.Email__c = env.fromAddress;
    ema.Description__c=email.subject;
   
    String [] emailBody = email.plainTextBody.split('\n', 0);
   
    ema.PhoneNumber__c = emailBody[0].substring(12);
    ema.Qualification__c = emailBody[1].substring(14);
    ema.Technology__c = emailBody[2].substring(11);
    ema.City__c = emailBody[3].substring(5);
    ema.State__c = emailBody[4].substring(6);
    ema.Country__c = emailBody[5].substring(8);
    }
    insert ema;
       Messaging.SingleEmailMessage emailsend = new Messaging.SingleEmailMessage();
        string [] toaddress= New string[]{env.fromAddress};
        emailsend .setSubject('Congragulation...!');
        emailsend .setPlainTextBody('Thanks For Sending your Information');
        emailsend .setToAddresses(toaddress);
        Messaging.sendEmail(New Messaging.SingleEmailMessage[]{emailsend });
    return res;
   
   
    }
   
        
}

<apex:page controller="AccountExample1" showHeader="true" action="{!ActionToDo}">
    <apex:form >
        <apex:sectionHeader title="New Account" subtitle="Edit Account" />
        
        <apex:pageBlock title="Account Edit" mode="Edit">
            
                <apex:pageBlockSection title="Account Information">
                    <apex:outputField value="{!acc.ownerID}"/>
                    <apex:inputField value="{!acc.Rating}"/>
                    <apex:inputField value="{!acc.Name}"/>
                    <apex:inputField value="{!acc.Phone}"/>
                    <!--<apex:inputField value="{!acc.Parent}"/>-->
                    <apex:inputField value="{!acc.Fax}"/>
                    <apex:inputField value="{!acc.AccountNumber}"/>
                    <apex:inputField value="{!acc.Website}"/>
                    <apex:inputField value="{!acc.Site}"/>
                    <apex:inputField value="{!acc.TickerSymbol}"/>
                    <apex:inputfield value="{!acc.Type}"/>
                    <apex:inputField value="{!acc.OwnerShip}"/>
                    <apex:inputField value="{!acc.Industry}"/>
                    <apex:inputfield value="{!acc.NumberOfEmployees}"/>
                    <apex:inputfield value="{!acc.AnnualRevenue}"/>
                    <apex:inputField value="{!acc.sic}"/>
                    <apex:inputField value="{!acc.Account_Email__c}" />
                    <apex:inputField value="{!acc.Count_Contacts__c}"/>
                    
                </apex:pageBlockSection>     
                <apex:pageBlockSection title="Account Information" >
                    <apex:inputTextarea value="{!acc.BillingStreet}"/>
                    <apex:inputTextarea value="{!acc.ShippingStreet}"/>
                    <apex:inputField value="{!acc.BillingCity}"/>
                    <apex:inputField value="{!acc.ShippingCity}"/>
                    <apex:inputfield value="{!acc.BillingState}"/>
                    <apex:inputField value="{!acc.ShippingState}"/>
                    <!--<apex:inputField  value="{!acc.BillingZip}"/>-->
                    <!--<apex:inputField value="{!acc.ShippingZip}"/>-->
                    
                
                </apex:pageBlockSection>
            <apex:pageBlockSection title="Account Information">
                <apex:inputfield value="{!acc.CustomerPriority__c}"/>
                <apex:inputField value="{!acc.SLA__c}"/>
                <apex:inputField value="{!acc.SLAExpirationDate__c}"/>
                <apex:inputField value="{!acc.SLASerialNumber__c}"/>
                <apex:inputField value="{!acc.NumberofLocations__c}"/>
                <apex:inputField value="{!acc.UpsellOpportunity__c}"/>
                <apex:inputField value="{!acc.Active__c}"/>
            
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Description Information">
                <apex:inputtextarea value="{!acc.Active__c}"/ >
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!Save}" />
            </apex:pageBlockButtons>
        </apex:pageBlock>
    
    </apex:form>
</apex:page>

 

 

 

 

 

public class AccountExample1
{
    public void Save() {
     //acc = new Account();
        insert acc;
    }

    public AccountExample1()
    {
       
        //acclist = [Select * from Account];
    }
    
    public Account acc{set;get;}
    //public List<Account> acclist{set;get;}
    public void ActionToDo()
    {
    }
}

when we r inserting a data in a field like if it is number field then i am writing an alpabet value it must display it as number variable in spot value

when we r inserting a data in a field like if it is number field then i am writing an alpabet value it must display it as number variable in spot value

<apex:page controller="AccountExample1" showHeader="true" action="{!ActionToDo}">
    <apex:form >
        <apex:sectionHeader title="New Account" subtitle="Edit Account" />
        
        <apex:pageBlock title="Account Edit" mode="Edit">
            
                <apex:pageBlockSection title="Account Information">
                    <apex:outputField value="{!acc.ownerID}"/>
                    <apex:inputField value="{!acc.Rating}"/>
                    <apex:inputField value="{!acc.Name}"/>
                    <apex:inputField value="{!acc.Phone}"/>
                    <!--<apex:inputField value="{!acc.Parent}"/>-->
                    <apex:inputField value="{!acc.Fax}"/>
                    <apex:inputField value="{!acc.AccountNumber}"/>
                    <apex:inputField value="{!acc.Website}"/>
                    <apex:inputField value="{!acc.Site}"/>
                    <apex:inputField value="{!acc.TickerSymbol}"/>
                    <apex:inputfield value="{!acc.Type}"/>
                    <apex:inputField value="{!acc.OwnerShip}"/>
                    <apex:inputField value="{!acc.Industry}"/>
                    <apex:inputfield value="{!acc.NumberOfEmployees}"/>
                    <apex:inputfield value="{!acc.AnnualRevenue}"/>
                    <apex:inputField value="{!acc.sic}"/>
                    <apex:inputField value="{!acc.Account_Email__c}" />
                    <apex:inputField value="{!acc.Count_Contacts__c}"/>
                    
                </apex:pageBlockSection>     
                <apex:pageBlockSection title="Account Information" >
                    <apex:inputTextarea value="{!acc.BillingStreet}"/>
                    <apex:inputTextarea value="{!acc.ShippingStreet}"/>
                    <apex:inputField value="{!acc.BillingCity}"/>
                    <apex:inputField value="{!acc.ShippingCity}"/>
                    <apex:inputfield value="{!acc.BillingState}"/>
                    <apex:inputField value="{!acc.ShippingState}"/>
                    <!--<apex:inputField  value="{!acc.BillingZip}"/>-->
                    <!--<apex:inputField value="{!acc.ShippingZip}"/>-->
                    
                
                </apex:pageBlockSection>
            <apex:pageBlockSection title="Account Information">
                <apex:inputfield value="{!acc.CustomerPriority__c}"/>
                <apex:inputField value="{!acc.SLA__c}"/>
                <apex:inputField value="{!acc.SLAExpirationDate__c}"/>
                <apex:inputField value="{!acc.SLASerialNumber__c}"/>
                <apex:inputField value="{!acc.NumberofLocations__c}"/>
                <apex:inputField value="{!acc.UpsellOpportunity__c}"/>
                <apex:inputField value="{!acc.Active__c}"/>
            
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Description Information">
                <apex:inputtextarea value="{!acc.Active__c}"/ >
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!Save}" />
            </apex:pageBlockButtons>
        </apex:pageBlock>
    
    </apex:form>
</apex:page>

 

 

 

 

 

public class AccountExample1
{
    public void Save() {
     //acc = new Account();
        insert acc;
    }

    public AccountExample1()
    {
       
        //acclist = [Select * from Account];
    }
    
    public Account acc{set;get;}
    //public List<Account> acclist{set;get;}
    public void ActionToDo()
    {
    }
}

<apex:dataTable value="{!Case}" var="c" border="1" >
                <apex:column title="OwnerId" value="{!c.OwnerId}"/>
                <apex:column value="{!c.LastName}"/>
                <apex:column value="{!c.Email}"/>
                <apex:column value="{!c.Id}"/>
            
            </apex:dataTable>

trigger ConCount on Account (After Update) {

    for(Account a:trigger.new)
    {
        list<Contact> lscon = [Select id from Contact where accountid=:a.id];
        update lscon;
        

    }
    
}

trigger MyCaseFirstFile on Case (Before insert)
{
for(Case ca:Trigger.new)
{
Contact con=[Select Phone,Name from Contact where (Account acc=[Select id, AnnualRevenue,Rating from Account where id=:con.Accountid)]];
Phone=9999999999;
update con;
}
}

IMAGE( CASE( Select_Multiple_Color__c ,
"Ash", "/resource/1362722614000/Ash",
"Black", "/resource/1362722679000/Black",
"Blue","/resource/1362722424000/Blue",
"Brown","/resource/1362722932000/Brown",
"Green","/resource/1362722445000/Green",
"Grey","/resource/1362722714000/Grey",
"Orange","/resource/1362722639000/Orange",
"Pink","/resource/1362722482000/Pink",
"Red","/resource/1362722574000/Red",
"Violet","/resource/1362722905000/Violet",
"Yellow","/resource/1362722509000/Yellow") ,"ColorImages")

 i want to pratice can any body give me some task to practice to improve my skills

public class AllAccountEx1_Controller
{
    public AllAccountEx1_Controller()
    {
        acct = new Account();
        
        accontblock=true;
    }
 
    public Account acct{set;get;}
    public Account getAcc()
    {
        return acct;
    }
    public list<Account> lst = new list<Account>();
    public list<Account> getAccounts()
    {
        lst = [Select Name,Site,BillingStreet,BillingCity,BillingState,Billingpostalcode,Billingcountry,Phone,Type,OwnerId, Account_Email__c from Account limit 100];
        
        return lst;
    }
    
    public boolean accountedit{set;get;}
    public boolean accontblock{set;get;}
    public pagereference onClick()
    {
        string idval = apexpages.currentpage().getparameters().get('accid');
        pagereference ref = new pagereference('/'+idval);
        return ref;
        
    }
    public account ac{set;get;}
    public pagereference Edit()
    {
        string selectedid=apexpages.currentpage().getparameters().get('acid');
        ac=[select id,name,Annualrevenue,Accountnumber from account where id=:selectedid];
        accountedit=true;
        accontblock=false;
    return null;
    }
    
    public void Del()
    {
       
       string selectedid=apexpages.currentpage().getparameters().get('accountid');
        account ac=[select id,name,Annualrevenue,Accountnumber from account where id=:selectedid];
        delete ac;
       
    }
    
    public void cancel()
    {
        
       
        //pagereference ref1 = new pagereference(acct.view());
        accountedit=false;
        accontblock=true;
        //return ref1;
    }
    public void getSave()
    {
              //string selectedid=apexpages.currentpage().getparameters().get('acid');
              
          // Account   acc1 = new Account();
              //acc1=[select id,name,Annualrevenue,Accountnumber from account where id=:selectedid];
                update ac;
                accountedit=false;
                accontblock=true;
        
    }
}

<apex:page controller="AccountExample1" showHeader="true" action="{!ActionToDo}">
    <apex:form >
        <apex:sectionHeader title="New Account" subtitle="Edit Account" />
        
        <apex:pageBlock title="Account Edit" mode="Edit">
            
                <apex:pageBlockSection title="Account Information">
                    <apex:outputField value="{!acc.ownerID}"/>
                    <apex:inputField value="{!acc.Rating}"/>
                    <apex:inputField value="{!acc.Name}"/>
                    <apex:inputField value="{!acc.Phone}"/>
                    <!--<apex:inputField value="{!acc.Parent}"/>-->
                    <apex:inputField value="{!acc.Fax}"/>
                    <apex:inputField value="{!acc.AccountNumber}"/>
                    <apex:inputField value="{!acc.Website}"/>
                    <apex:inputField value="{!acc.Site}"/>
                    <apex:inputField value="{!acc.TickerSymbol}"/>
                    <apex:inputfield value="{!acc.Type}"/>
                    <apex:inputField value="{!acc.OwnerShip}"/>
                    <apex:inputField value="{!acc.Industry}"/>
                    <apex:inputfield value="{!acc.NumberOfEmployees}"/>
                    <apex:inputfield value="{!acc.AnnualRevenue}"/>
                    <apex:inputField value="{!acc.sic}"/>
                    <apex:inputField value="{!acc.Account_Email__c}" />
                    <apex:inputField value="{!acc.Count_Contacts__c}"/>
                    
                </apex:pageBlockSection>     
                <apex:pageBlockSection title="Account Information" >
                    <apex:inputTextarea value="{!acc.BillingStreet}"/>
                    <apex:inputTextarea value="{!acc.ShippingStreet}"/>
                    <apex:inputField value="{!acc.BillingCity}"/>
                    <apex:inputField value="{!acc.ShippingCity}"/>
                    <apex:inputfield value="{!acc.BillingState}"/>
                    <apex:inputField value="{!acc.ShippingState}"/>
                    <!--<apex:inputField  value="{!acc.BillingZip}"/>-->
                    <!--<apex:inputField value="{!acc.ShippingZip}"/>-->
                    
                
                </apex:pageBlockSection>
            <apex:pageBlockSection title="Account Information">
                <apex:inputfield value="{!acc.CustomerPriority__c}"/>
                <apex:inputField value="{!acc.SLA__c}"/>
                <apex:inputField value="{!acc.SLAExpirationDate__c}"/>
                <apex:inputField value="{!acc.SLASerialNumber__c}"/>
                <apex:inputField value="{!acc.NumberofLocations__c}"/>
                <apex:inputField value="{!acc.UpsellOpportunity__c}"/>
                <apex:inputField value="{!acc.Active__c}"/>
            
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Description Information">
                <apex:inputtextarea value="{!acc.Active__c}"/ >
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!Save}" />
            </apex:pageBlockButtons>
        </apex:pageBlock>
    
    </apex:form>
</apex:page>

 

 

 

 

 

public class AccountExample1
{
    public void Save() {
     //acc = new Account();
        insert acc;
    }

    public AccountExample1()
    {
       
        //acclist = [Select * from Account];
    }
    
    public Account acc{set;get;}
    //public List<Account> acclist{set;get;}
    public void ActionToDo()
    {
    }
}