Wednesday, June 28, 2017

Enable Inline Editing in Salesforce View List

Inline Editing in Salesforce.com

 

Salesforce.com provides Inline Editing feature which is applicable to the entire organization – ADM 201 Certification Question

Inline editing is a feature by which one can edit a record without pressing the edit button. User goes to the detail page, doubles click on a field, changes to a new value and presses save. This process makes sure the field value is updated to the new value.

Inline editing limitations:-
  • Does not work for all fields, some fields are exception to Inline editing like opportunity stage.
  • Inline editing can not be turned on for one user and turned off for another. It is global and works for all or none – ADM 201 Certification Question
To set inline editing go to: Setup – customize – UI Settings – inline editing

Business advantage:- Saves on the no. of clicks required to edit a record.

Point to Remember:- If you have changed a value using Inline Editing but forgot to press the save button then those changes will not be saved and will get discarded as soon as you close that particular window.

 

 



Salesforce.com allow user to edit data directly in page layout when your System Administrator enable inline editing feature, except for read-only and system fields. Editable fields display a pencil icon (Editable Field) when you hover over the field, while non-editable fields display a lock icon (Uneditable Field).

On top of inline editing in page layout, user also can do inline editing in view list without any effort to write any code. Many system administrators may not aware of this feature and sometimes it will not work because of some conditions.

Here are the items need to check for inline editing in page view:

1. Enable Inline Editing and Enhanced Lists
Go to Setup - App Setup - Customize - User Interface













2. Do you have record type for specific object?
If the object has multiple record types, you have to filter the view only showing 1 record type. So if you have 3 record type for Contact, you need to create 3 view. Please note, you should not have more than 1 record type in the record type filter, otherwise inline editing in view will not work.
If there is no record type for that object, you can skip this filtering.

3. Do not add Filter Logic
You are not allowed to use filter logic to enable inline editing in list view. 

















4. Not for User object
As of now, this is not available for user object, please vote in IdeaExchange.

5. Edit multiple record at the same time
This feature is very nice if you need to edit many records to a same value. Select checkbox at the left of records and click pencil icon. Then select apply changes to all selected records.









Inline Editing in Visualforce Page.

Inline Edit:
We all know that we can edit the value of a field by going to the Edit Page,edit it and Save it using the Save button. But Salesforce besides that provides an efficient of editing a value of a field from the detail page of a record OR from List View of records which is very efficient for users and less time consuming. Just by double clicking on the Field Value a popup will open where we can edit the value and save it. But Salesforce provides that inBuilt only in their Standard Pages. To create that in our Custom Visualforce Pages we have to write code for that. Here is a small example of using INLINE EDIT in Visualforce Pages..
Visualforce Page :
<!-- VisualForce Page Responsible for Entry of Contact Records -->
<apex:page controller="AccountPageController">
<apex:form>
<apex:pageBlock title="Account Information" >
<apex:pageBlockTable value="{!acc}" var="a" title="Results">
<apex:inlineEditSupport showOnEdit="update, cancelButton"
 hideOnEdit="editButton" event="ondblclick"
changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
<apex:column headerValue="Name">
<apex:outputfield value="{!a.name}"/>
</apex:column>
<apex:column headerValue="id">
<apex:outputfield value="{!a.id}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:commandButton id="update" action="{!quickUpdat}"value="UpdateRecord"/>
</apex:form>
</apex:page>
Apex Class:
// Apex Controller responsible for Entry of Account Records
public class AccountPageController {
public list <Account> acc {get;set;}
public String message{get;set;}
public AccountPageController(){
string searchquery='select name,id from Account Limit 20';
 acc= Database.query(searchquery);
}
public PageReference quickUpdat(){
try{
update acc;
return ApexPages.CurrentPage();
}catch(Exception e){
message='Data Base error during saving...';
ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.ERROR,      message));
return null;
}
}
}

Explanation:

The Visualforce Page here is a Detail Page of a Account Record means here field values are displayed in a noneditable state. Now if one wants to edit some specific field values(here for e.g Name) then instead of going to the Edit Page you can edit that field value here only just by double clicking on that.
--------------

Hi,
In this post i am giving basic example of how to work with inline editing in visualforce page.

Controller Class:
public class AccountInlineEditCLs {
public List<account> acclst=new List<account>();

public List<account> getAccounts(){
 acclst=[select name,industry,type,Description from account];
      return acclst;

}

public void save1() {
     update acclst;
}
}

Visualforce Page:

<apex:page controller="AccountInlineEditCLs">
<apex:form >
<apex:pageBlock mode="inlineEdit">
<apex:pageBlockButtons >
<apex:commandbutton value="save" action="{!save1}"/>
</apex:pageBlockButtons>
<!-- calling getAccounts() methods in pageblock table -->
<apex:pageBlockTable value="{!accounts}" var="a">
<apex:column Headervalue="Account Name">
<apex:outputfield value="{!a.name}"/>
</apex:column>
<apex:column headervalue="Industry">
<apex:outputfield value="{!a.industry}"/>
</apex:column>
<apex:column >
<apex:outputfield value="{!a.type}"/>
</apex:column>

</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Output: 

save image

save image




Salesforce: change email address without confirmation



How to change user email address without confirmation


As security measure in Salesforce, when admin change user email address (maybe in sandbox, typo or other reasons), Salesforce will send an verification email to the new email address, user need to verify by click a link in the email. Before user verify the link, email address will not change, no matter how many times you do it, even using API.

But, can admin change the email address without confirmation email? Yes, here is the trick:


  • Click Edit on user detail page
  • Change the email address AND check "Generate new password and notify user immediately" checkbox (all the way at the bottom of the edit screen) at the same time
  • Click Save button
Salesforce will change email address immediately, no confirmation is needed! But, of course password will be reset and user will get email from Salesforce with a new temporary password. This is still better than ask user to verify email changed then reset password.

No comments:

Post a Comment