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 Customer Records -->
<apex:page controller="CustomerEntryPageController">
<apex:form>
<apex:pageBlock title="Customer Information" >
<apex:pageMessages />
<!-- Display Save and Cancel Button -->
<apex:pageBlockButtons >
<apex:commandButton value="Save" id="saveButton" action="{!savingCustomerRecord}"/>
</apex:pageBlockButtons>
<!-- A PageBlockSection for Entry and Display Customer Values -->
<apex:pageBlockSection title="Information" columns="2">
<apex:outputField value="{!customerObj.Name}"/>
<apex:outputField value="{!customerObj.Address__c}">
<apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick"/>
</apex:outputField>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
Apex Class
/**
*@purpose : Apex Controller responsible for Entry of Customer Records
*@author : Souvik
**/
public with sharing class CustomerEntryPageController {
public Customer__c customerObj{get;set;}
String customerId{get;set;}
public String message{get;set;}
/**
*@purpose : Constructor to fetch current Customer Record and its Action
**/
public CustomerEntryPageController () {
message = '';
// Fetching the Current Customer Id
customerId = System.currentPageReference().getParameters().get('Id');
if(cutomerId != NULL){
customerObj = [SELECT Id,Name,Address__c FROM Customer__c WHERE id=:customerId];
}
}
/**
*@purpose : Method for Saving the Customer Object Record
*@param : None
*@return : PageReference to Standard Salesforce Record Detail Page
**/
public PageReference savingCustomerRecord(){
try{
upsert customerObj;
PageReference nextpage= new PageReference('/'+customerObj.id);
return nextpage;
}
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 Customer 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 Address__c) then he instead of going to the Edit Page he can edit that field value here only just by double clicking on that.
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 Customer Records -->
<apex:page controller="CustomerEntryPageController">
<apex:form>
<apex:pageBlock title="Customer Information" >
<apex:pageMessages />
<!-- Display Save and Cancel Button -->
<apex:pageBlockButtons >
<apex:commandButton value="Save" id="saveButton" action="{!savingCustomerRecord}"/>
</apex:pageBlockButtons>
<!-- A PageBlockSection for Entry and Display Customer Values -->
<apex:pageBlockSection title="Information" columns="2">
<apex:outputField value="{!customerObj.Name}"/>
<apex:outputField value="{!customerObj.Address__c}">
<apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick"/>
</apex:outputField>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
Apex Class
/**
*@purpose : Apex Controller responsible for Entry of Customer Records
*@author : Souvik
**/
public with sharing class CustomerEntryPageController {
public Customer__c customerObj{get;set;}
String customerId{get;set;}
public String message{get;set;}
/**
*@purpose : Constructor to fetch current Customer Record and its Action
**/
public CustomerEntryPageController () {
message = '';
// Fetching the Current Customer Id
customerId = System.currentPageReference().getParameters().get('Id');
if(cutomerId != NULL){
customerObj = [SELECT Id,Name,Address__c FROM Customer__c WHERE id=:customerId];
}
}
/**
*@purpose : Method for Saving the Customer Object Record
*@param : None
*@return : PageReference to Standard Salesforce Record Detail Page
**/
public PageReference savingCustomerRecord(){
try{
upsert customerObj;
PageReference nextpage= new PageReference('/'+customerObj.id);
return nextpage;
}
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 Customer 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 Address__c) then he instead of going to the Edit Page he can edit that field value here only just by double clicking on that.
PRAGMATIC218: Gambling Online - aprCasino.com
ReplyDeleteThe world's most popular casino games. 더킹 카지노 사이트 The casino offers some of the best games and bonus offers in the online casino world,
Antalya
ReplyDeleteKonya
Adana
Ankara
Van
TBQ
düzce
ReplyDeletesakarya
tunceli
van
bayburt
NMC6X
görüntülü show
ReplyDeleteücretlishow
İGCRV
https://titandijital.com.tr/
ReplyDeletesakarya parça eşya taşıma
aksaray parça eşya taşıma
urfa parça eşya taşıma
kocaeli parça eşya taşıma
KBE7EQ
sivas evden eve nakliyat
ReplyDeleteerzurum evden eve nakliyat
bitlis evden eve nakliyat
mardin evden eve nakliyat
rize evden eve nakliyat
4LE
izmir evden eve nakliyat
ReplyDeletemalatya evden eve nakliyat
hatay evden eve nakliyat
kocaeli evden eve nakliyat
mersin evden eve nakliyat
GX2İ
ankara evden eve nakliyat
ReplyDeletemalatya evden eve nakliyat
antep evden eve nakliyat
giresun evden eve nakliyat
kayseri evden eve nakliyat
E8WHZL
https://istanbulolala.biz/
ReplyDeleteO30ZR
trabzon evden eve nakliyat
ReplyDeletebursa evden eve nakliyat
ordu evden eve nakliyat
erzurum evden eve nakliyat
mardin evden eve nakliyat
7VF5FK
tekirdağ evden eve nakliyat
ReplyDeletekocaeli evden eve nakliyat
yozgat evden eve nakliyat
osmaniye evden eve nakliyat
amasya evden eve nakliyat
7İ124
düzce evden eve nakliyat
ReplyDeletedenizli evden eve nakliyat
kırşehir evden eve nakliyat
çorum evden eve nakliyat
afyon evden eve nakliyat
B6K7
36494
ReplyDeleteÜnye Koltuk Kaplama
Ünye Televizyon Tamircisi
Huobi Güvenilir mi
Probit Güvenilir mi
Çerkezköy Petek Temizleme
Mersin Lojistik
Çankaya Parke Ustası
Bitmex Güvenilir mi
Ankara Evden Eve Nakliyat
D7C95
ReplyDeleteKütahya Şehirler Arası Nakliyat
Batıkent Boya Ustası
Çorum Şehir İçi Nakliyat
Denizli Şehirler Arası Nakliyat
Gümüşhane Parça Eşya Taşıma
Zonguldak Şehir İçi Nakliyat
Çerkezköy Oto Boya
Bingöl Şehirler Arası Nakliyat
Referans Kimliği Nedir
B647F
ReplyDeleteUşak Parça Eşya Taşıma
Karaman Parça Eşya Taşıma
Amasya Lojistik
Konya Lojistik
Çerkezköy Fayans Ustası
Çerkezköy Buzdolabı Tamircisi
Mexc Güvenilir mi
Çankırı Şehir İçi Nakliyat
Bursa Parça Eşya Taşıma
8F70E
ReplyDeleteBinance Referans Kodu
Bitlis Lojistik
Sakarya Lojistik
Iğdır Parça Eşya Taşıma
Giresun Lojistik
Ceek Coin Hangi Borsada
Ardahan Evden Eve Nakliyat
Karaman Lojistik
Tekirdağ Evden Eve Nakliyat
8B0E5
ReplyDeleteHatay Şehirler Arası Nakliyat
Ünye Marangoz
Bitcoin Kazanma
Ağrı Şehirler Arası Nakliyat
NWC Coin Hangi Borsada
Gümüşhane Şehirler Arası Nakliyat
Çerkezköy Petek Temizleme
Hatay Evden Eve Nakliyat
Kırşehir Şehir İçi Nakliyat
B108B
ReplyDeleteNiğde Şehir İçi Nakliyat
Pancakeswap Güvenilir mi
Batman Evden Eve Nakliyat
halotestin for sale
Gölbaşı Boya Ustası
Yozgat Lojistik
Osmaniye Lojistik
Ankara Lojistik
Çerkezköy Çatı Ustası
C722D
ReplyDeleteAdıyaman Lojistik
Gölbaşı Parke Ustası
Mamak Fayans Ustası
Bitmart Güvenilir mi
Ankara Evden Eve Nakliyat
Bartın Şehirler Arası Nakliyat
Çerkezköy Marangoz
Kütahya Lojistik
Çerkezköy Oto Lastik
B4973
ReplyDeleteKırşehir Evden Eve Nakliyat
buy pharmacy steroids
Adana Evden Eve Nakliyat
sarms
Urfa Evden Eve Nakliyat
Maraş Evden Eve Nakliyat
Samsun Evden Eve Nakliyat
Denizli Evden Eve Nakliyat
buy winstrol stanozolol
EFCFE
ReplyDeletebinance indirim kodu
3E967
ReplyDeleteKripto Para Çıkarma Siteleri
Yeni Çıkan Coin Nasıl Alınır
Bitcoin Mining Nasıl Yapılır
Binance Ne Zaman Kuruldu
Kripto Para Nasıl Üretilir
Binance Hesap Açma
Kripto Para Nasıl Alınır
Coin Nasıl Oynanır
Gate io Borsası Güvenilir mi
19E87
ReplyDeletebinance referans kodu
resimli magnet
resimli magnet
binance referans kodu
resimli magnet
binance referans kodu
referans kimliği nedir
binance referans kodu
referans kimliği nedir
203AB
ReplyDeletesightcare
47A93
ReplyDeletepancakeswap
avax
shiba
trezor suite
trust wallet
sushi
roninchain
dcent
safepal
8ACE3
ReplyDeletebitexen
4g proxy
bitcoin ne zaman yükselir
bingx
bitcoin haram mı
kizlarla canli sohbet
bitcoin nasıl üretilir
kraken
paribu
F13C5E5D42
ReplyDeletedogwifhat
emoji coin
tokenfi
rocketpool
puffer
aethir
dymension stake
mitosis
emojicoin
شركة مكافحة الصراصير بالاحساء ZM01iJeTD1
ReplyDelete8F1C8C10CF
ReplyDeleteturk takipci satin al