• Amit_
  • NEWBIE
  • 10 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 16
    Questions
  • 39
    Replies
Hi,
I have a requirement where I need to show some set of data in vf page and as the user scroll down the next set data should be displayed onto the page...kind of lazy loading...I dont have much I idea how to acheave this functionality any help is highly appriceated
thanks,
  • September 13, 2014
  • Like
  • 0

Hi,

I have simple requirement, I have a webservice class which accepts some parameters as,


global class someclass{

               

               list<apexclassImage> imageLst{get;set;}{imageLst = new list<apexclassImage>();}

along with other string parameter I am getting a list which has filename and fileBody as blob from java side this is my method signature.

webservice static string myMethod(string, string,string......, list<apexclassImage> imageLst){

I want to insert the list<apexclassImage> imageLst to Attachment. this list may contain sigle image or Multiple Image.
but I am not able to insert in the Body filed of attachment from the list.

I am able to insert value to other object from the passed value.

          for(interger i=0; i<= imageLst.size(); i++){


                   Attachment att = new Attachment();

         }

/* I have created a wrapper class in webservice class itself as and declared a list of wrapper in webservice */
global class apexclassImage{
          global string fileName{get;set;}
          global Blob fileBody{get;set;}
}

Please suggest me how to get the multiple elements from the list and attachment. Any suggeston is appriciated.

Thanks & Regards,

  • October 09, 2013
  • Like
  • 0

Hi,

 

I have a requirement  where I am getting Arraylist<blob> data which basically contain one or multiple Image from webservice class I need to parse this blob data and get the image file from it and insert/update it in my object. I have no idea how to insert the image to an object from the blob data. Any help is highly appriciated.

 

Thanks & Regards,

  • September 23, 2013
  • Like
  • 0

Hi, 

 

I have a requirement where I have to create a Custom button and place it on case detail Standard page layout but I have to make it visible only if a Value in Status field in case is ="Required" and should not come on case detail page if the status value is other than "Required". 

I am stuck with this, any help is highly appriciated.

 

thanks & Regards,

 

  • September 18, 2013
  • Like
  • 0

Hi I have a requirement where on contact object I will have to create new Custom button and on click of that button it will send out mail. that is simple but the problem is I have to auto populate the Addition to and CC filed with some email Id like sample@g.com , sample2@g.com like that based on the particular email template choosen.

I dont have any idea how to achieve it any help is highly appriciate.

 

Thanks and Regards

  • September 04, 2013
  • Like
  • 0

Hi All,

 

I have a requirement , where on my VF page I have to rate a Content. Like I have to display a 5 stars and on click of the number of starts it will rate that Content.

Any suggestion is highly appricaited.

 

Thanks & Regards     

  • June 28, 2013
  • Like
  • 0

Hi , I am new to salesforce so Have some issue with myrequirement.

I have a simple requirement, where I have a picklist filed on Contact object and same picklist on Account and opportunities, I have a requirement where on Insert or Update of Picklist filed in contact the same should be insert or updated in picklist filed of Account and its related Opportunity picklist filed object.

any help and suggestion is highly appricated.

 

Thanks & Reagrds,

 

 

  • June 27, 2013
  • Like
  • 0

Hi

I have simple requirement, I need to disaplay  a document list in alpha order and have an alpha bar navigation to easily jump to pages on Visualforce page(Similar to apex class/ visualforce list page which displays the list of class and on click of specific character like "C" or "D" or any other char it display result based on the charecter clicked) I need a soultion something like that any suggestion is highly appricated.

 

Thanks in Advance.

  • June 25, 2013
  • Like
  • 0

I have a Vf controller class which has a wrapper class and does operation like search based on some criteria, and insert a record to table. now I'll have to write a test class form my controller class. please help me out I am very new to writting Test class. here is snippet of my code though I have not followed a good pratice while writing code i ma doing it for my learning purpose. here is what I have done in Controller ;


public class ProductDetails {


/* ****************  Default Constructor start **************** */

    public ProductDetails(ApexPages.StandardController controller) {

    }
   
/* ****************  Default Constructor End ****************   */


    public void productAddToList(){
       
        set<id> prid =  new set<id>();
        if(string.isNotBlank(ProductPrice) ==False){ 
            if(string.isNotBlank(ProductName)== True){
                lstProd= [select Name,Category__c,id,ProductCode  from product2 where  Name like  :'%' +ProductName+ '%'];
            }
            else if(string.isNotBlank(productCategory)==True){
                lstProd = [select Name,Category__c,id,ProductCode  from product2 where  Category__c like:'%' +productCategory+ '%'];
            }
                else if(string.isNotBlank(ProductCode)==True){
                   lstProd = [select Name,Category__c,id,ProductCode  from product2 where ProductCode like :'%'+ProductCode+'%'];
                }
        for(product2 po : lstprod){
            prid.add(po.id);
            prname.add(po.Name);   
        }
        pricebke = [select Product2Id,UnitPrice from pricebookentry where Product2Id in :prid and UseStandardPrice=True];
       
        for(product2 product : lstprod){
            for(pricebookentry price : pricebke){
                if(product.id==price.Product2Id){
                    ProductWarpper prodwap = new ProductWarpper();
                    prodwap.prodObj= product;
                    prodwap.pricebookObj=price;
                    //prodwap.quantity=1;
                    prodwap.totalPrice=price.UnitPrice;
                    prodwap.amount = integer.valueOf(price.UnitPrice);
                    prodwap.isSelected = False;
                    lsPwr.add(prodwap);
                }
            }
        }
       
            
             ProductName= null;
             productCategory = null;
             ProductCode = null;
             ProductPrice =  null;     
        }
        else {
            prc= decimal.valueOf(ProductPrice);
            pricebke = [select Product2Id,UnitPrice from pricebookentry where UnitPrice = :prc and UseStandardPrice=True];
            for(pricebookentry pbkebtry : pricebke ){
                prid.add(pbkebtry.Product2Id);
            }
            lstProd= [select Name,Category__c,id,ProductCode  from product2 where  id in :prid ];
            for(product2 product : lstprod){
                for(pricebookentry price : pricebke){
                    if(product.id==price.Product2Id){
                        ProductWarpper prodwap = new ProductWarpper();
                        prodwap.prodObj= product;
                        prodwap.pricebookObj=price;
                        //prodwap.quantity=1;
                        prodwap.totalPrice=price.UnitPrice;
                        prodwap.amount = integer.valueOf(price.UnitPrice);
                        prodwap.isSelected = False;
                        lsPwr.add(prodwap);
                    }
                }
            }
         
            ProductName= null;
            productCategory = null;
            ProductCode = null;
            ProductPrice =  null;  
          }
    }       
    public void removeRef(){
        for(ProductWarpper cCon: selectedProd){           
                if(cCon.isSelected == false) 
                {                       
                removedProd.add(cCon);
                }                          
            }
       
   
    }
    public pageReference calAmount(){
                   
        return null;
   
    }              
    public list<ProductWarpper> getProdName(){
               productAddToList();                      
       return lsPwr;
    }
                                            
/* ****************    login to add Selected product to kart Start ****************    */ 
   
    public PageReference selectedValue() {
           totalcall();
           for(ProductWarpper cCon:lsPwr){           
                if(cCon.isSelected ==true) 
                { 
                    kartWrapper kartwrp = new kartWrapper();
                    kartwrp.prdlist = cCon;
                    kartList.add(kartwrp);
                    selectedProd.add(cCon);
                }
                cCon.isSelected = False;                          
            }          
         return null;
        }

/* ****************    login to add Selected product to kart End ****************    */ 
/*  ****************   method to redirect page to Oder Page to display the list of Items odered start ****************   */

     public PageReference myAccount(){
            PageReference pageRef = new PageReference('/apex/MyOrderAccount');   
            pageRef.setRedirect(true);       
            return pageRef;
     }
/*  ****************    method to redirect page to Oder Page to display the list of Items odered End ****************   */                                      
/* ****************    Declearing the Wrapper Class start **************** */       
        public class ProductWarpper{
       
        public pricebookentry  pricebookObj {get;set;}
        public Product2 prodObj{get;set;}
        public boolean isSelected {get;set;}
        public integer quantity {get;set;}
        public integer amount{get;set;}
        public decimal totalPrice{get;set;}
        public decimal totalamount {get;set;}
        public decimal getTotal(){
            system.debug('WrapperQuantity    '+this.quantity+    'WrapperPrice    '+ this.totalPrice);
            totalamount = this.quantity * this.totalPrice;
            return totalamount;
        }
      
        }                          
        public  class kartWrapper{
            public ProductWarpper prdlist{get;set;}
        }
   
/* ****************    Declearing the Wrapper Class End ****************  */
       public void totalcall(){
           for (ProductWarpper wrap : selectedProd)
           {
                 System.debug('Total = ' + wrap.getTotal());
           }
       }
/* ****************    Login to search Product based on search key Start ****************    */ 
 
        public PageReference search() {
       
            lsPwr.clear();
            removedProd.clear();
            productAddToList();
           
            return null;     
       
        }
        public PageReference searchProduct(){
       
            search();
            return null;   
        }
/* ****************    Login to search Product based on search key End ****************    */
        public PageReference cancel(){
            lsPwr.clear();
            selectedProd.clear();
            return null;
         }   
/* ****************    Login to Insert and create order start ****************    */
     
       public void OrderPlaced(){
           list<Product2> prodlist = new list<product2>();
               for(ProductWarpper pw : lsPwr){
                   prodlist.add(pw.prodObj);
               }
               OrderItem__c odrt = new OrderItem__c();
               insert odrt;
               list<OrderItem__c>soqlid =[select id from OrderItem__c order by createddate desc];
                   system.debug('get OderId' + soqlid);
                   list<Order__c> orderlist = new list<order__c>();
                   for(ProductWarpper pw : selectedProd){
                   Order__c odr = new Order__c();
                       odr.OrderItem__c = soqlid[0].id;
                       odr.Product2__c =  pw.prodObj.id;
                       odr.OrderCategory__c = pw.prodObj.Category__c;
                       odr.Price__c = pw.pricebookObj.UnitPrice;
                       odr.Quantity__c = pw.quantity;                      
                       orderlist.add(odr);
                   }
                   insert orderlist;
                   selectedProd.clear();
                   lsPwr.clear();
       }
/* ****************    Login to Insert and create order End ****************    */
/* ****************    Login to Remove Items from the Kart start ****************    */
                                    
        public PageReference removeItem(){
            removeRef();
            selectedProd.clear();
        return null;       
        }
        public void editMethod(){}
        public void remove(){
            removeRef();
            selectedProd.clear();

        }
/* ****************    Login to Remove Items from the Kart End ****************    */
      
/* ****************    login to Render Pageblock Sections Start ****************   */       
        public boolean getfirstSection(){
            boolean render =( lsPwr==null || lsPwr.size() ==0? false : true);
            return render;
        }
        public boolean getRendered(){
        Boolean render = (selectedProd== null || selectedProd.size() == 0 ? false : true);
       
        return render;
        }
        public boolean getremovedProdRender(){
            boolean render = (removedProd == null || removedProd.size()==0? false : true);
            return render;
        }
      
/* ****************    login to Render Pageblock Sections End ****************   */
                

    public PageReference methodOne() {
        return null;
    }
                
    public void setState(string n) {
        state = n;
    }
    public void setrestate(string n) {
        restate = n;
    }       
    public string getrestate() {
        return restate ;
    }               
    public string getState() {
        return state;
    }   
    public string state = 'False';
    public string restate = 'True';
   
   
    public void delRow()
    {
        rowNum = Integer.valueOf(apexpages.currentpage().getparameters().get('index'));
        selectedProd.remove(rowNum);  
   
    }
}

 

how will do the code coverage for my code please suggest me.

Thanks & Regards

Amit_

  • May 27, 2013
  • Like
  • 0

Hi All,

I have a small requirement where the values are displayed on VF page and on click of pageblockbutton Edit, the quantity field should become editable

how will i achive that here what i am trying to do :

 

<apex:outputpanel id="cartshow">           
        <apex:facet name="header"></apex:facet>  
            <apex:pageBlock title="Selected items" id="cartsho" mode="readonly" rendered="{!rendered}">
                <apex:detail inlineEdit="true"/>
                <apex:pageBlockButtons >   
                    <apex:commandButton value="Remove Items" action="{!removeItem}"/>
                    <apex:commandButton value="Place Order" action="{!OrderPlaced}"/>
                    <apex:commandButton value="Edit" action="{!editOrder}" onclick="computeTotal"/>
                </apex:pageBlockButtons>
                <apex:pageBlockTable value="{!selectedProd}" var="c" >
                    <apex:column headerValue="Select">
                        <apex:inputCheckbox value="{!c.isSelected}"/>
                    </apex:column>
                    <apex:column width="20px">
                        <apex:commandButton value="Remove" action="{!remove}"/>                   
                    </apex:column>
                    <apex:column value="{!c.prodObj.name}" headerValue="Product Name" width="390px"/>
                    <apex:column value="{!c.prodObj.ProductCode}" headerValue="Product code"/>
                    <apex:column value="{!c.prodObj.Category__c}" headerValue="Product Category" width="390px"/>
                    <apex:column value="{!c.pricebookObj.UnitPrice}" headerValue="Product Price"/>
                    <apex:column value="{!c.quantity }" headerValue="Quantity"/>

                     <apex:column headerValue=" amount"

                                     <apex:outputText  /> </apex:column
                </apex:pageBlockTable>                
           </apex:pageBlock>
     </apex:outputPanel>

my requirement is on click of Edit button, I should be able to insert quantity and able to add amount. like quantity * amount.

Please suggest me some idea so that I can solve my issue.

Thanks & Regards,

Amit_

  • May 20, 2013
  • Like
  • 0

Hi all,

 

I am facing some starnge problem I dont know why my values are not populating on pageblocktable. I am using JavaScript this is my Js :

 <script>
      function computeTotal(quantityId,unitPriceId,totalId){
      alert('JS being Called');
      var quantity = document.getElementById(quantityId).value;   
      var cost = document.getElementById(unitPriceId).innerHTML;          
      var totalPrice = quantity * cost ;
      document.getElementById(totalId).innerHTML = totalPrice;
      }

</script>

and i am calling this JS method form pageblocktable

<apex:column headerValue="Quantity" >
                    <apex:inputtext value="{!tmpVar.quantity }"  onChange="('{!$Component.quantityId}','{!$Component.unitPriceId}','{!$Component.totalId}')" id="quantityId"/>

</apex:column>

<apex:column headerValue="total">
                    <apex:outputText id="totalId"/>
</apex:column>

 

But i dont know why the values are not populating in my Total column field.

any suggestion and help will be great help to me.

 

Thanks & Regards,

Amit_

  • May 20, 2013
  • Like
  • 0

Hi All,

First of all thanks for looking my post. I am facing a small problem, if you can look at my code nad help me out then it will be great help. the problem is I have quantity, unitPrice and Amout fileds in VF page. Quantity and amount is a entity of Wrapper class and unitPrice is a entity of pricebooktable. Now my requirement is onChange of qunity the amout should automatically be calculated as Quantity * UnitPrice, here what I am trying to do : 

<apex:pageBlockTable value="{!lsPwr}" var="tmpVar">
<apex:column headerValue="Select">
<apex:inputCheckbox value="{!tmpVar.isSelected}"/>
</apex:column>
<apex:column value="{!tmpVar.prodObj.name}" headerValue="Product Name"/>
<apex:column value="{!tmpVar.prodObj.ProductCode}" headerValue="Product code"/>
<apex:column value="{!tmpVar.prodObj.Category__c}" headerValue="Product Category"/>
<apex:column id="productUnitPrice" value="{!tmpVar.pricebookObj.UnitPrice}" headerValue="Product Price Per Unit"/>
<apex:column headerValue="Quantity">
<apex:inputtext value="{!tmpVar.quantity }">
<apex:actionSupport event="onchange" reRender="quantity" />
</apex:inputText>
</apex:column>
<apex:column id="quantity" value="{!tmpVar.pricebookObj.UnitPrice}*{!tmpVar.quantity }" headerValue="Amount"/>
</apex:pageBlockTable>

 

lsPwr is a list of wrapper class. I dont know how to display amount as(unitPrice * quantity) I am using apex:actionSupport event =onChange on inputtext quantity.

 

please suggest me to solve the problem.

 

 

Thanks & Regards,

Amit_

  • May 18, 2013
  • Like
  • 0

Hi all,

First of all thanks for giving your valuable time to look at my post.

I have a simple requirment  to display the price list related to product in visualforce page. I have created a wrapper class to display Prodcut name , code but i dont know how to display price of the associated product. here what I am trying  to do ...

 

Wrapper class :

public class ProductWarpper{
       
        public Product2 prodObj{get;set;}
        public boolean isSelected {get;set;}
        public integer quantity {get;set;}
        public list<integer> price {get;set;}
                            
}

public PageReference selectedValue() {

selectedProd = new list<ProductWarpper>();
             
            for(ProductWarpper cCon:getProdName()){           
                if(cCon.isSelected ==true) 
                {                       
                selectedProd.add(cCon);
                }                          
            }
            set<id> pids = new set<id>();
            for(ProductWarpper p: selectedProd){
                    pids.add(p.prodObj.id);
            }
            system.debug('new id' + pids);
            prbkentry =[select UnitPrice from pricebookentry where Product2Id in :pids];
            system.debug('Unit Price' + prbkentry);
            for(integer i=0;i>= prbkentry.size();i++ ){
                    pricebook.add(Integer.valueOf(prbkentry[i].UnitPrice));
               
            }

return null;

}

public list<ProductWarpper> getProdName(){
              

lstProd= [select Name,Category__c,id,ProductCode  from product2 where  Name like :'%'+searchkey +'%' or Category__c like : '%'+searchkey +'%' or ProductCode like : '%'+searchkey +'%' ];
            for(product2 prod : lstProd){
                    ProductWarpper prodwap = new ProductWarpper();
                    prodwap.prodObj= prod;                                        
                    lsPwr.add(prodwap);                   
            }
    return lsPwr;
    }

 

this is my Vf page where I am displaying the filed value :

<apex:pageBlockTable value="{!lsPwr}" var="tmpVar">
                <apex:column headerValue="Select">
                    <apex:inputCheckbox value="{!tmpVar.isSelected}"/>
                </apex:column>
                <apex:column value="{!tmpVar.prodObj.name}" headerValue="Product Name"/>
                <apex:column value="{!tmpVar.prodObj.ProductCode}" headerValue="Product code"/>
                <apex:column value="{!tmpVar.prodObj.Category__c}" headerValue="Product Category"/>
                <apex:column value="{!tmpVar.price}" headerValue="Product Price"/>
                <apex:inputtext value="{!tmpVar.quantity }" label="Quantity"/>                                   
            </apex:pageBlockTable>
       </apex:pageBlock>

please help me to solve my issue.

 

Thanks & Regards,

Amit_

 

  • May 17, 2013
  • Like
  • 0

Hi Everyone,

I have requirement to pass the selected values from one page block section to another page block section on the same VF page. currently I am passing the selected values to second VF page using PageReference. here is my code. please help me out. I 'm very new to VF and Salesforce.

/**********************        Vfpage 1         ********************** /

<apex:page standardController="Product2" extensions="Product">
    <apex:form >
        Enter Search key:    <apex:inputText value="{!searchkey}"/>
        <apex:commandButton value="Search" action="{!search}"/>
        <apex:commandButton value="Add To Cart" action="{!selectedValue}"/>

    <br/>
    <apex:pageBlock title="Product Details" tabStyle="Product__c">
        <apex:pageBlockTable value="{!lsPwr}" var="tmpVar">
            <apex:column headerValue="Select">
                <apex:inputCheckbox value="{!tmpVar.isSelected}"/>
            </apex:column>
            <apex:column value="{!tmpVar.prodObj.name}" headerValue="Product Name"/>
            <apex:column value="{!tmpVar.prodObj.Category__c}" headerValue="Product Category"/>
                                   
        </apex:pageBlockTable>
   </apex:pageBlock>
   </apex:form>
</apex:page>

/**********************        Vfpage 2         ********************** /

<apex:page standardController="Product2" extensions="Product">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!Selectedproducts}" var="c" id="table">
            <apex:column value="{!c.prodObj.name}" headerValue="Product Name"/>
            <apex:column value="{!c.prodObj.Category__c}" headerValue="Product Category"/>
            <apex:column headerValue="Quantity">
                <apex:inputText value="{!c.quantity }"/>
            </apex:column>                           
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>


</apex:page>

 

/**********************       Controller         ********************** /

public class Product {
    public Product() {

    }


    public Product(ApexPages.StandardController controller) {

    }


    public integer totalQuantity;
    public list<ProductWarpper> getSelectedproducts() {
        selectedProd = new list<ProductWarpper>();
             
        for(ProductWarpper cCon:getProdName())
        {           
            if(cCon.isSelected ==true) 
            {                       
                selectedProd.add(cCon);
            }                          
        }  
        totalQuantity = selectedProd.size(); 
        system.debug('Size of seletced Items' + totalQuantity);  
        return selectedProd;          
    }
        public PageReference selectedValue() {
        PageReference pageRef= new PageReference('/apex/AddSelectedProduct');
        pageRef.setredirect(false);       
        return pageRef;     
    }
    public String searchkey { get; set; }
    public integer prc;
    public class ProductWarpper{
   
        public Product2 prodObj{get;set;}
        public boolean isSelected {get;set;}
        public integer quantity {get;set;}
           
    }
    public List<product2> lstProd{get;set;}
    public list<product2> newLstProd{get;set;}
    public list<ProductWarpper> lsPwr{get;set;} {lsPwr= new list<ProductWarpper>();}
    public list<ProductWarpper> selectedProd{get;set;}
    public PageReference search() {
            lsPwr.clear();
            lstProd= [select Name,Category__c from product2 where  Name like :'%'+searchkey +'%' or Category__c like : '%'+searchkey +'%' ];
            system.debug('Controller Class    '+lstProd);
                for(product2 prod : lstProd){
                    ProductWarpper prodwap = new ProductWarpper();
                    prodwap.prodObj= prod;
                    lsPwr.add(prodwap);
                }
            
        return null;
   
   }
   public list<ProductWarpper> getProdName(){
       list<PricebookEntry> prclist = new list<PricebookEntry>();
       newLstProd= [select Name,Category__c,id from product2 where  Name like :'%'+searchkey +'%' or Category__c like : '%'+searchkey +'%'  ];
       set<id> ids = new set<id>();
       system.debug('Controller Class    '+lstProd);
                for(product2 prod : newLstProd){
                    ProductWarpper prodwap = new ProductWarpper();
                    prodwap.prodObj= prod;
                    lsPwr.add(prodwap);
                    ids.add(prod.id);
                }
       prclist = [select UnitPrice from PricebookEntry where Product2Id in:ids ];
               
        return lsPwr;
    }   

  
}

 

And I also need to display the product unit price to the 2 pageblocksection along with other deatils.

And Suggestion will be great help for me

 

Thanks & Reagrds,

Amit

  • May 10, 2013
  • Like
  • 0

Hi,

I am new to salesfroce, so I'm trying to develop a simple piece of code but I'm having some issue with it, any help is trully appricated.

 

here is what I want, I have two objects Class__c  with fileds NumberOfStudents(RollUP field), Name, MaxLimit (Number)and Studebt__c has field FirstName__c, LastName__c , id.  here what I am doing :

* =================================================================================

    Trigger to restrict user to insert records if the max limit of calss has reached
   
   ================================================================================= */

trigger StudentBeforeInsert on Student__c (before insert) {
    set<id>stids= new set<id>();
        for(student__c stu: trigger.new){
            stids.add(stu.id);
        }
    list<student__c> std = new list<student__c>();
    std =[select class__r.name from student__c where id in :stids];
    set<student__c> stSet = new set<student__c>();
        stSet.addAll(std);   
    system.debug('From Data Loader====  :'+ std);
    List<class__c> cls = new list<class__c>();
    cls=[select MaxLimit__c,NumberOfStudents__c from class__c where name =:stSet]; get error at thisline as Invalid bind expression type of SOBJECT:Student__c for column of type String at line 19 column 69

basic idea I have is I want to find the NumberOfStudent already in the class and the maxList of the class and then to compare these two filed for which the user is trying to insert the record in student record. if value in both the field is asme then it will not allow to insert any record, or else it will go ahead with inserting record into the table.

 

Please give me some suggestion, so that I can learn and code

 

Thanks in Advance.

  • May 06, 2013
  • Like
  • 0

Hi everyone,

I have small doubt, and I dont know how to solve it . Please help me to solve my issue. I'm new to salesforce

list<sObject> slist = new list<sObject>();

sList =[select TotalSize__c from sObject where id in : 90908908];

TotalSize__c is a Integer field.

 

How will I compare the value of TotalSize__c  that I got in sList to theTotalSize__c Integer data type as sList returns sObject data type.

I am trying to comapre using if conditon (if sList.get[0] == 4). it is throwing error as :

Compile Error: Initial term of field expression must be a concrete SObject: LIST<sObject> for the line number : (if sList.get[0] == 4).

  • May 02, 2013
  • Like
  • 0
Hi All,

   
    Can any one Explain me Before and After events in trigger?When we are going for Before and when we are going for After in Triggers?


Thanks

Hello,

I'm trying to release a new dev made in sandbox. One of the class had already been released in prod from the sandbox but it's not blocking.

Here is the error message I get :

Failure Message: "System.NullPointerException: Attempt to de-reference a null object", Failure Stack Trace: "Class.PricerOffer.firstList: line 177, column 1 Class.PricerController_TEST.pricerControllerTest: line 52, column 1"

And here is the code of the test until some lines below the line 52:

@isTest
public class PricerController_TEST {

  // -------------------------------------
    // pricerControllerTest() method
    // ------------------------------------- 
  static testMethod void pricerControllerTest() {
    // Data Model
    PricerUtils_TEST.loadPricerData();
   
    test.startTest();
   
        PageReference oPageRef = new PageReference('/apex/Pricer?oppId=' + PricerUtils_TEST.oOpp.Id);
        test.setCurrentPageReference(oPageRef);
        PricerController oPricerController = new PricerController();
        PricerSiteOffer.bIsTest = true;
       
        system.debug(Logginglevel.ERROR, '### SFDC - PricerController_TEST - pricerControllerTest() - PricerUtils_TEST.lRV.size():' + PricerUtils_TEST.lRV.size());
   
    // Initializing  Pricer options
    oPricerController.oOfferOption.sDateDebutContrat = String.valueOf(system.today().toStartOfMonth());
    oPricerController.oOfferOption.oOffer.X12_mois__c = true;
    oPricerController.oOfferOption.oOffer.X24_mois__c = false;
    oPricerController.oOfferOption.oOffer.X36_mois__c = false;
    oPricerController.oOfferOption.oOffer.X48_mois__c = false;
    oPricerController.oOfferOption.oOffer.TECH_Duree_mois__c = '12';
    oPricerController.oOfferOption.oOffer.Cout_variable_transport__c = 'Oui';
    oPricerController.oOfferOption.oOffer.Offre_regulee__c = 'Oui';
    oPricerController.oOfferOption.oOffer.Copropriete_Clinique_Public__c = 'Oui';
    oPricerController.oOfferOption.oOffer.Assujetti_TVA__c = true;
    system.assertEquals(PricerController.bBatchSendEmail, true);
    system.assertNotEquals(PricerOption.lDateDebutContrat.size(), 0);
    system.assertNotEquals(PricerOption.sDateValiditeOffre, null);
    system.assertNotEquals(PricerOption.sDateFinMaxOffre, null); 
   
    // Execute Pricer
    oPricerController.executeBatchOrNot();
    system.assertEquals(oPricerController.oOfferOption.lOffer.size(), 2);
   
    integer i=0;
        for (PricerOffer oPricerOffer:oPricerController.lOffer){
      system.assertequals(oPricerOffer.iNbExistingSiteOffer, 3);
     
      // Save offer
            oPricerOffer.saveOffer();
           
            // Pagination functionality
            if(i==0){
              system.assertNotEquals(PricerOffer.DISPLAYSITEDETAIL, null);
              system.assertNotEquals(PricerOffer.NBSITESAVECDETAIL, null);
             
              oPricerOffer.firstList();
              oPricerOffer.nextList();
              oPricerOffer.previousList();
              oPricerOffer.lastList();
            }           
            i++;
        }

I'm not a dev but I'm surprised this is now posing problem because before it has been released ok. Also, our salesforce org hasn't changed much, although we created some unique IDs which were posing problems but I removed them and the test is now failing only at this step.

Thanks for your help

Regards,

Hi,

I wrote an Apex trigger that looks up country, state and region values inserted in Leads on a custom setting containing a canonical list and replaces the entered values with the canonical values.

I am aware that when you match using field "name" of an entry in your custom setting, you don't need SOQL. The problem is that certain country names are too long to fit in the character limit. That obliges the use of SOQL. I need help to bulkify this one as I never bulkified a trigger before.

Thanks in advance!

Here is my trigger:

trigger ProperCountryStateRegionLead on lead (before insert, before update) {
for(lead lead : Trigger.new){

// checks if country field is empty
if(lead.Country != null){

// creates a variable with the country value inserted by the user
Set<String> inputcountry = new Set<String>();

// populates the variable with a lower case version of the country value inserted by the user
inputcountry.add(lead.Country.toLowerCase());

// queries via SOQL a custom settings list containing all variations of country names and returns the good data integrity key
List<CountryDataMatch__c> goodcountry =[SELECT DataIntegrityKey__c FROM CountryDataMatch__c WHERE Alternative__c IN: inputcountry];

// checks if the list goodcountry is empty, if it is it's because the inserted value is not among the country name variations 
if (goodcountry.isEmpty() == false){

// looks for the good country name in another custom settings list using the data integrity key
CountryDataIntegrity__c valuecountry = CountryDataIntegrity__c.getValues(goodcountry[0].DataIntegrityKey__c);

// checks if the good country name value has been found
if(valuecountry != null){

// replaces the inserted country value with the good country name
lead.Country = valuecountry.Value__c;

// inserts ISO 3166-1 alpha2 country code in country code custom field
lead.Country_Code__c = goodcountry[0].DataIntegrityKey__c;

}
}
}
}

for(lead lead : Trigger.new){

// checks if state field is empty
if(lead.state != null){

// creates a variable with the state value inserted by the user
Set<String> inputstate = new Set<String>();

// populates the variable with a lower case version of the state value inserted by the user
inputstate.add(lead.state.toLowerCase());

// queries via SOQL a custom settings list containing all variations of state names and returns the good data integrity key
List<StateDataMatch__c> goodstate =[SELECT DataIntegrityKey__c FROM StateDataMatch__c WHERE Alternative__c IN: inputstate AND Country_Code__c =: lead.Country_Code__c];

// checks if the list goodstate is empty, if it is it's because the inserted value is not among the state name variations 
if (goodstate.isEmpty() == false){

// creates a variable with the good data integrity key
string goodstatestring = goodstate[0].DataIntegrityKey__c;

// queries for the good state name via SOQL a custom settings list containing all data integrity keys matching with the respective country
List<StateDataIntegrity__c> valuestate = [SELECT Value__c FROM StateDataIntegrity__c WHERE Name =: goodstatestring]; 

// checks if valuestate list is empty
if (valuestate.isEmpty() == false){

// creates a variable with the good state name
string valuestatestring = valuestate[0].Value__c;

// checks if the good country name value has been found
if(valuestate != null){

// replaces the inserted country value with the good country name
lead.state = valuestatestring;

}
}
}
}
}
for(lead lead : Trigger.new){

//maps custom settings list containing the commercial regions
map<String, CountryRegion__c> regions = CountryRegion__c.getAll();

// sets variable with country name
 string countryforregion = lead.Country_Code__c;

// checks if country field is empty
    if(countryforregion == null){
    
// if country field empty, set commercial region field to null    
    lead.Commercial_Region__c = null;
    }
    
// if country field not empty, try to retrieve region on custom settings list   
    else if(countryforregion != null) {    
    CountryRegion__c matchcountryregion = regions.get(countryforregion);

// if region retrieved, set region to commercial region field
    if(matchcountryregion != null){
    lead.Commercial_Region__c = CountryRegion__c.getInstance(lead.Country_Code__c).Commercial_Region__c;
    }
    
// if failed, set commercial region field to null    
    else {lead.Commercial_Region__c = null;
    }
}    
}
    for(lead lead : Trigger.new){

//maps custom settings list containing the commercial regions
map<String, CountryRegion__c> regions = CountryRegion__c.getAll();

// sets variable with country name
 string countryforregion = lead.Country_Code__c;

// checks if country field is empty
    if(countryforregion == null){
    
// if country field empty, set commercial region field to null    
    lead.Geo_Region__c = null;
    }
    
// if country field not empty, try to retrieve region on custom settings list   
    else if(countryforregion != null) {    
    CountryRegion__c matchcountryregion = regions.get(countryforregion);

// if region retrieved, set region to commercial region field
    if(matchcountryregion != null){
    lead.Geo_Region__c = CountryRegion__c.getInstance(lead.Country_Code__c).Geo_Region__c;
    }
    
// if failed, set commercial region field to null    
    else {lead.Geo_Region__c = null;
    }
}    
}
     for(lead lead : Trigger.new){

//maps custom settings list containing the commercial regions
map<String, CountryRegion__c> regions = CountryRegion__c.getAll();

// sets variable with country name
 string countryforregion = lead.Country_Code__c;

// checks if country field is empty
    if(countryforregion == null){
    
// if country field empty, set commercial region field to null    
    lead.Geo_Subregion__c = null;
    }
    
// if country field not empty, try to retrieve region on custom settings list   
    else if(countryforregion != null) {    
    CountryRegion__c matchcountryregion = regions.get(countryforregion);

// if region retrieved, set region to commercial region field
    if(matchcountryregion != null){
    lead.Geo_Subregion__c = CountryRegion__c.getInstance(lead.Country_Code__c).Geo_Subregion__c;
    }
    
// if failed, set commercial region field to null    
    else {lead.Geo_Subregion__c = null;
    }
}    
}
}

Hi Friends,

We are calling the Visualforce pages of one salesforce org from another salesforce org using the SSO (Single sign On). Sometimes it generates an error message like "insufficient Privilege error."

Please let me know what is the reason for this error.

Thanks And Regards
Manish Sharma
why  i am getting String index out range:-1 error ?

Hi,

 

I have a requirement  where I am getting Arraylist<blob> data which basically contain one or multiple Image from webservice class I need to parse this blob data and get the image file from it and insert/update it in my object. I have no idea how to insert the image to an object from the blob data. Any help is highly appriciated.

 

Thanks & Regards,

  • September 23, 2013
  • Like
  • 0

Hi, 

 

I have a requirement where I have to create a Custom button and place it on case detail Standard page layout but I have to make it visible only if a Value in Status field in case is ="Required" and should not come on case detail page if the status value is other than "Required". 

I am stuck with this, any help is highly appriciated.

 

thanks & Regards,

 

  • September 18, 2013
  • Like
  • 0

Hi I have a requirement where on contact object I will have to create new Custom button and on click of that button it will send out mail. that is simple but the problem is I have to auto populate the Addition to and CC filed with some email Id like sample@g.com , sample2@g.com like that based on the particular email template choosen.

I dont have any idea how to achieve it any help is highly appriciate.

 

Thanks and Regards

  • September 04, 2013
  • Like
  • 0

Hi , I am new to salesforce so Have some issue with myrequirement.

I have a simple requirement, where I have a picklist filed on Contact object and same picklist on Account and opportunities, I have a requirement where on Insert or Update of Picklist filed in contact the same should be insert or updated in picklist filed of Account and its related Opportunity picklist filed object.

any help and suggestion is highly appricated.

 

Thanks & Reagrds,

 

 

  • June 27, 2013
  • Like
  • 0

Hi

I have simple requirement, I need to disaplay  a document list in alpha order and have an alpha bar navigation to easily jump to pages on Visualforce page(Similar to apex class/ visualforce list page which displays the list of class and on click of specific character like "C" or "D" or any other char it display result based on the charecter clicked) I need a soultion something like that any suggestion is highly appricated.

 

Thanks in Advance.

  • June 25, 2013
  • Like
  • 0

I have a Vf controller class which has a wrapper class and does operation like search based on some criteria, and insert a record to table. now I'll have to write a test class form my controller class. please help me out I am very new to writting Test class. here is snippet of my code though I have not followed a good pratice while writing code i ma doing it for my learning purpose. here is what I have done in Controller ;


public class ProductDetails {


/* ****************  Default Constructor start **************** */

    public ProductDetails(ApexPages.StandardController controller) {

    }
   
/* ****************  Default Constructor End ****************   */


    public void productAddToList(){
       
        set<id> prid =  new set<id>();
        if(string.isNotBlank(ProductPrice) ==False){ 
            if(string.isNotBlank(ProductName)== True){
                lstProd= [select Name,Category__c,id,ProductCode  from product2 where  Name like  :'%' +ProductName+ '%'];
            }
            else if(string.isNotBlank(productCategory)==True){
                lstProd = [select Name,Category__c,id,ProductCode  from product2 where  Category__c like:'%' +productCategory+ '%'];
            }
                else if(string.isNotBlank(ProductCode)==True){
                   lstProd = [select Name,Category__c,id,ProductCode  from product2 where ProductCode like :'%'+ProductCode+'%'];
                }
        for(product2 po : lstprod){
            prid.add(po.id);
            prname.add(po.Name);   
        }
        pricebke = [select Product2Id,UnitPrice from pricebookentry where Product2Id in :prid and UseStandardPrice=True];
       
        for(product2 product : lstprod){
            for(pricebookentry price : pricebke){
                if(product.id==price.Product2Id){
                    ProductWarpper prodwap = new ProductWarpper();
                    prodwap.prodObj= product;
                    prodwap.pricebookObj=price;
                    //prodwap.quantity=1;
                    prodwap.totalPrice=price.UnitPrice;
                    prodwap.amount = integer.valueOf(price.UnitPrice);
                    prodwap.isSelected = False;
                    lsPwr.add(prodwap);
                }
            }
        }
       
            
             ProductName= null;
             productCategory = null;
             ProductCode = null;
             ProductPrice =  null;     
        }
        else {
            prc= decimal.valueOf(ProductPrice);
            pricebke = [select Product2Id,UnitPrice from pricebookentry where UnitPrice = :prc and UseStandardPrice=True];
            for(pricebookentry pbkebtry : pricebke ){
                prid.add(pbkebtry.Product2Id);
            }
            lstProd= [select Name,Category__c,id,ProductCode  from product2 where  id in :prid ];
            for(product2 product : lstprod){
                for(pricebookentry price : pricebke){
                    if(product.id==price.Product2Id){
                        ProductWarpper prodwap = new ProductWarpper();
                        prodwap.prodObj= product;
                        prodwap.pricebookObj=price;
                        //prodwap.quantity=1;
                        prodwap.totalPrice=price.UnitPrice;
                        prodwap.amount = integer.valueOf(price.UnitPrice);
                        prodwap.isSelected = False;
                        lsPwr.add(prodwap);
                    }
                }
            }
         
            ProductName= null;
            productCategory = null;
            ProductCode = null;
            ProductPrice =  null;  
          }
    }       
    public void removeRef(){
        for(ProductWarpper cCon: selectedProd){           
                if(cCon.isSelected == false) 
                {                       
                removedProd.add(cCon);
                }                          
            }
       
   
    }
    public pageReference calAmount(){
                   
        return null;
   
    }              
    public list<ProductWarpper> getProdName(){
               productAddToList();                      
       return lsPwr;
    }
                                            
/* ****************    login to add Selected product to kart Start ****************    */ 
   
    public PageReference selectedValue() {
           totalcall();
           for(ProductWarpper cCon:lsPwr){           
                if(cCon.isSelected ==true) 
                { 
                    kartWrapper kartwrp = new kartWrapper();
                    kartwrp.prdlist = cCon;
                    kartList.add(kartwrp);
                    selectedProd.add(cCon);
                }
                cCon.isSelected = False;                          
            }          
         return null;
        }

/* ****************    login to add Selected product to kart End ****************    */ 
/*  ****************   method to redirect page to Oder Page to display the list of Items odered start ****************   */

     public PageReference myAccount(){
            PageReference pageRef = new PageReference('/apex/MyOrderAccount');   
            pageRef.setRedirect(true);       
            return pageRef;
     }
/*  ****************    method to redirect page to Oder Page to display the list of Items odered End ****************   */                                      
/* ****************    Declearing the Wrapper Class start **************** */       
        public class ProductWarpper{
       
        public pricebookentry  pricebookObj {get;set;}
        public Product2 prodObj{get;set;}
        public boolean isSelected {get;set;}
        public integer quantity {get;set;}
        public integer amount{get;set;}
        public decimal totalPrice{get;set;}
        public decimal totalamount {get;set;}
        public decimal getTotal(){
            system.debug('WrapperQuantity    '+this.quantity+    'WrapperPrice    '+ this.totalPrice);
            totalamount = this.quantity * this.totalPrice;
            return totalamount;
        }
      
        }                          
        public  class kartWrapper{
            public ProductWarpper prdlist{get;set;}
        }
   
/* ****************    Declearing the Wrapper Class End ****************  */
       public void totalcall(){
           for (ProductWarpper wrap : selectedProd)
           {
                 System.debug('Total = ' + wrap.getTotal());
           }
       }
/* ****************    Login to search Product based on search key Start ****************    */ 
 
        public PageReference search() {
       
            lsPwr.clear();
            removedProd.clear();
            productAddToList();
           
            return null;     
       
        }
        public PageReference searchProduct(){
       
            search();
            return null;   
        }
/* ****************    Login to search Product based on search key End ****************    */
        public PageReference cancel(){
            lsPwr.clear();
            selectedProd.clear();
            return null;
         }   
/* ****************    Login to Insert and create order start ****************    */
     
       public void OrderPlaced(){
           list<Product2> prodlist = new list<product2>();
               for(ProductWarpper pw : lsPwr){
                   prodlist.add(pw.prodObj);
               }
               OrderItem__c odrt = new OrderItem__c();
               insert odrt;
               list<OrderItem__c>soqlid =[select id from OrderItem__c order by createddate desc];
                   system.debug('get OderId' + soqlid);
                   list<Order__c> orderlist = new list<order__c>();
                   for(ProductWarpper pw : selectedProd){
                   Order__c odr = new Order__c();
                       odr.OrderItem__c = soqlid[0].id;
                       odr.Product2__c =  pw.prodObj.id;
                       odr.OrderCategory__c = pw.prodObj.Category__c;
                       odr.Price__c = pw.pricebookObj.UnitPrice;
                       odr.Quantity__c = pw.quantity;                      
                       orderlist.add(odr);
                   }
                   insert orderlist;
                   selectedProd.clear();
                   lsPwr.clear();
       }
/* ****************    Login to Insert and create order End ****************    */
/* ****************    Login to Remove Items from the Kart start ****************    */
                                    
        public PageReference removeItem(){
            removeRef();
            selectedProd.clear();
        return null;       
        }
        public void editMethod(){}
        public void remove(){
            removeRef();
            selectedProd.clear();

        }
/* ****************    Login to Remove Items from the Kart End ****************    */
      
/* ****************    login to Render Pageblock Sections Start ****************   */       
        public boolean getfirstSection(){
            boolean render =( lsPwr==null || lsPwr.size() ==0? false : true);
            return render;
        }
        public boolean getRendered(){
        Boolean render = (selectedProd== null || selectedProd.size() == 0 ? false : true);
       
        return render;
        }
        public boolean getremovedProdRender(){
            boolean render = (removedProd == null || removedProd.size()==0? false : true);
            return render;
        }
      
/* ****************    login to Render Pageblock Sections End ****************   */
                

    public PageReference methodOne() {
        return null;
    }
                
    public void setState(string n) {
        state = n;
    }
    public void setrestate(string n) {
        restate = n;
    }       
    public string getrestate() {
        return restate ;
    }               
    public string getState() {
        return state;
    }   
    public string state = 'False';
    public string restate = 'True';
   
   
    public void delRow()
    {
        rowNum = Integer.valueOf(apexpages.currentpage().getparameters().get('index'));
        selectedProd.remove(rowNum);  
   
    }
}

 

how will do the code coverage for my code please suggest me.

Thanks & Regards

Amit_

  • May 27, 2013
  • Like
  • 0

I'm getting the followig error in my test method:

constructor not defined: [AccountOpenCasesExtension].<Constructor>()

 

I instantiated the class file and called my initialize method that is called within the constructor.  I'm not clear on why the constructor is not defined.  Shouldn't the constructor execute when the class is instantiated?

 

Here is my class file:

 

public class AccountOpenCasesExtension { private List<Account> accounts; public List<Account> getAccounts() { return accounts; } public AccountOpenCasesExtension(ApexPages.StandardController stdController) { init((Account)stdController.getRecord()); //accounts = [Select id, name, (Select Owner.Name, Contact.Name, CaseNumber, Subject, CreatedDate From Cases WHERE IsClosed = false) From Account a WHERE id =: stdController.getId()]; } public void init(Account a) { accounts = [Select id, name, (Select Owner.Name, Contact.Name, CaseNumber, Subject, CreatedDate From Cases WHERE IsClosed = false) From Account a WHERE id =: a.Id]; } static testMethod void test() { Account acct = [Select id, name, (Select Owner.Name, Contact.Name, CaseNumber, Subject, CreatedDate From Cases WHERE IsClosed = false) From Account a LIMIT 1]; AccountOpenCasesExtension ctrl = new AccountOpenCasesExtension(); ctrl.init(acct); } }

 

Hi, I am trying to make an attachment page on one of my custom pages. I am unable to find any totorial for this particular purpose. Can somebody please refer me to some tutorial that associates an attachment to the custom objects and controls.

 

I came accross teh follwoing example of uploading attachments. I am unable to run this code because I dont find any option to create the extension for the standardController-Document

 

    

<apex:page standardController="Document" extensions="documentExt"> <-- Upload a file and put it in your personal documents folder--> <apex:messages /> <apex:form id="theForm"> <apex:pageBlock> <apex:pageBlockSection> <apex:inputFile value="{!document.body}" filename="{!document.name}"/> <apex:commandButton value="save" action="{!save}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> /*** Controller ***/ public class documentExt { Appendix D: Standard Component Reference inputFile public documentExt(ApexPages.StandardController controller) { Document d = (Document) controller.getRecord(); d.folderid = UserInfo.getUserId(); //this puts it in My Personal Documents } }

 

Can someone please help me in:

1- How can I associate an attachments to my records when I am working with a custom controller (some code or step by step tutorial).

2- How can I add an extension when I am using a standard controlle

I use a controller to display a list of products with a checkbox against each product value . When the end user selects few products and clicks "add quantity" button it should navigate to another VF page in which i should display the selected products and an input filed for quantity. Quite similiar to the way of adding products in opportunity. In the code below im using a single controller for 2 VF pages. Problem i m facing here is when the second page is called the wrapperList becomes null instead of holding the values of the selected products. Please give me some suggestions.

 

public with sharing class productAdd
{        
    public  List<Product2> Stdproduct{get;set;}
    public List<wrapper> wrapperList {get;set;}  
    public list<wrapper> SelectedprodList{get;set;}	
    public class wrapper
    {
        public product2 cont{get;set;}
        public Boolean selected{get;set;}
        public integer quantity{get;set;}
        public wrapper(product2 c)
        {
            cont = c;
            selected = false;
        } 
    }
	public  List<wrapper> getProdList()
    {        
        if((wrapperList == null) || (wrapperList.size() == 0))
        {                      
            wrapperList = new List<wrapper>();
            Stdproduct = [Select id, Name from product2 limit 2];           
            for(Product2 c :(List<Product2>)Stdproduct)            
            {               
                wrapperList.add(new wrapper(c));
            }
        }             
        return wrapperList;
    }
    
    public PageReference AddQuantity()
    {   
        PageReference pageRef= new PageReference('/apex/AddQuantity');
        pageRef.setredirect(true);        
        return pageRef;           
    }

    public list<wrapper> getSelectedproducts()
    {
        selectedprodList = new list<wrapper>();      
        for(wrapper cCon:getProdList())
        {            
            if(cCon.selected==true)  
            {                        
                selectedprodList.add(cCon);
            }                           
        }        
        return selectedprodList;           
    }        
}

<!-- 1st Page -->
<apex:page Controller="productAdd" sidebar="false">
    <table  width="90%">
	    <apex:form>
			<apex:repeat value="{!ProdList}" var="l" >               
				<tr>
				<td>
				<apex:inputCheckbox value="{!l.selected}"/>
				</td>
				<td class="fieldname">{!l.cont.name}</td>                       
				</tr>                
			</apex:repeat>
				<tr>
				<apex:commandButton value="Add Quantity" action="{!AddQuantity}"/>
				</tr>             
	    </apex:form> 
    </table>
</apex:page>


<!-- 2nd Page -->
<apex:page Controller="productAdd">
	<apex:form >
		<apex:pageBlock > 
			<apex:pageBlockTable value="{!Selectedproducts}" var="c" id="table"> 
				<apex:column value="{!c.cont.Name}" />                
				<apex:column >
				<apex:inputText value="{!c.quantity}"/>
				</apex:column> 
			</apex:pageBlockTable> 
		</apex:pageBlock> 
	</apex:form> 
</apex:page>