You need to sign in to do that
Don't have an account?

Insert Account through VF page
Hi,
I want to work on below task, Can anyone please help me in that task
Create a visual force page with two page blocks, one showing the existing Accounts and another for inserting new accounts. The inserted account also needs to be dynamically displayed in the existing Account list.
Thanks in Advance.
I want to work on below task, Can anyone please help me in that task
Create a visual force page with two page blocks, one showing the existing Accounts and another for inserting new accounts. The inserted account also needs to be dynamically displayed in the existing Account list.
Thanks in Advance.
Here is the code for Insert account. for display List Existing record make another pageblock just display account, also dont forget to referesh the list block after insert.
Page:
Controller:
Hope this will help you,
Mark Best ANSWER if its works for you.
Thanks
karthik
This is not my requirement.
My requirement is, in one pageblock all the account should be displayed and other pageblock is to insert account. And inserted account should be dynamically added to the displayed list.
i have requriment could you please share u r code.
Below is the code for your requirement.
<apex:page controller="multiAccountInsert">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!accts}" var="a">
<apex:column value="{!a.Name}"/>
<apex:column value="{!a.Industry}"/>
<apex:column value="{!a.phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockButtons location="Bottom" >
<apex:commandButton value="Save" action="{!Save}" id="display" />
</apex:pageBlockButtons>
<apex:pageblocksection >
Enter Name: <apex:inputText value="{!AccountName}"/>
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>
==========================================================
public class multiAccountInsert{
public Account at { get; set; }
public String AccountName{get;set;}
public PageReference Save() {
at = new Account();
at.Name=AccountName;
insert at;
return null;
}
public List<Account> accts {get; set;}
public multiAccountInsert(){
accts = new List<Account>();
accts = [Select id, Name, Industry, Phone from Account];
}
}
Thank you sending code.
i go through the code
i wanna ask that if i wanna show the newly inserted record on top of the table.then what will i do?