• Pushkar Gupta
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
i want to create contact records using checkbox in vf page 
Apex Controller:

public class AddmultipleContactsVF {
      Contact Cont = new Contact();
      public list<Contact> listContact{get;set;}
      public Boolean IsSelected{set;get;}

       public AddmultipleContactsVF()
      {     
      listContact=new list<Contact>();
      listContact.add(Cont);
      }
      
      Public void addContact()
      {
      Contact con = new Contact();
      listContact.add(con);
      }
      public PageReference saveContact() {    
      for(Integer i=1; i<listContact.size(); i++)
      {
      if(Isselected==true){
      upsert listContact;
      }
      } 
      return null;
      }
public class wrapperContact{
      public Boolean IsSelected{set;get;}
      public wrapperContact(){
      IsSelected=false;
      }
}
}
VF Page:
<apex:page Controller="AddmultipleContactsVF">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!listContact}" var="con">
<apex:column headerValue="Contact LastName">
<apex:inputCheckbox value="{!IsSelected}" id="InputId"/>
<apex:inputField value="{!con.LastName}"/>
<apex:CommandButton value="+" action="{!addContact}"/>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:CommandButton value="Save Contact" action="{!saveContact}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>User-added image
 
 i have a question regarding trigger. I have two custom field on Account namely Country And State., And same field on Contact Whenever i choose the country on contact state get automatically filled using account state field if the country is same in account field.
we have to add a discount on the product on account for this you need to create 5 fields Tier1 to 5 on account in which you can specify the discount % Also,create one picklist on product with values Tier 1 to tier 5 to select Tier. When a new product is added with Tier value under opp then the discount will be applicable only when tier is mentioned on product and Discount for that Tier is mentioned on Account.
 when a user updates another user record .an email should go to real opp owner that this user has updated your record. plz help me with this.
 i have a question regarding trigger. I have two custom field on Account namely Country And State., And same field on Contact Whenever i choose the country on contact state get automatically filled using account state field if the country is same in account field.
 when a user updates another user record .an email should go to real opp owner that this user has updated your record. plz help me with this.