-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
3Replies
hello all , i have a question regarding the vf page
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>
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>
- Pushkar Gupta
- July 19, 2018
- Like
- 0
- Continue reading or reply
hi, trigger on account to update contact information
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.
- Pushkar Gupta
- June 21, 2018
- Like
- 0
- Continue reading or reply
Hello guys, can anyone help me with this
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.
- Pushkar Gupta
- June 14, 2018
- Like
- 0
- Continue reading or reply
Hello all, i have a question regarding the process builder.
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.
- Pushkar Gupta
- June 14, 2018
- Like
- 0
- Continue reading or reply
hi, trigger on account to update contact information
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.
- Pushkar Gupta
- June 21, 2018
- Like
- 0
- Continue reading or reply
Hello all, i have a question regarding the process builder.
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.
- Pushkar Gupta
- June 14, 2018
- Like
- 0
- Continue reading or reply