Skip to main content

Posts

Showing posts from November, 2009

List View Editing of Accounts

Imagine if you can have a list view of Accounts where users can view accounts, edit accounts in place? Well, it will be the most user friendly system.

Obviously, best practice is, open the list view with less fields and then allow users to edit the page with the less number of fields and if they wish to see details, have a detail page link.

The following code does just this for you.


VisualForce Page: inPlaceAccounts.page

<apex:page controller="AccountsController" tabstyle="Account"> <apex:sectionheader subtitle="{!$User.FirstName} {!$User.LastName}" title="Quick Edit Accounts"> <apex:pagemessages> <apex:form> <apex:actionfunction action="{!saveEditAcc}" name="saveEdit"> <apex:pageblock title="Add New Account"> <apex:pageblocksection> <b>Name:</b> <apex:inputtext value="{!newAccount.Name}"> …