When we override edit button of any object in sales force then inline editing of that object in other standard layouts are disabled for that specific object.
We can provide inline editing in visualforce page for which we have overridden the edit button, but if object uses different record types and based on record types different standard page layouts are assigned then inline editing is disabled in all that layouts.
To Enable inline editing in all other standard layouts, we have to do the following steps
Do not override the object with any visualforce page, instead do the page redirect from home page component.
Create a home page component with following javascript code, and add that home page component to the current home page layout.
<script>
var objectCode = window.top.location.pathname.substring(1,4);
var isedit = window.top.location.pathname.substring(16,18);
var noOverride = window.top.location.search.search('nooverride=1');
if(objectCode == 'objCode' && (isedit == '/e') && noOverride == -1){
var pid = window.top.location.pathname.substring(1,16);
window.top.location = '/apex/VisualforcePage?id='+pid;
}
</script>
in that visualforce page perform proper redirection in action method of page, and redirect page to standard layout by adding nooverride=1 in the url
ex:
http://salesforceInstance/Recordid?nooverride=1
Hope this helps!!
Thanks
We can provide inline editing in visualforce page for which we have overridden the edit button, but if object uses different record types and based on record types different standard page layouts are assigned then inline editing is disabled in all that layouts.
To Enable inline editing in all other standard layouts, we have to do the following steps
Do not override the object with any visualforce page, instead do the page redirect from home page component.
Create a home page component with following javascript code, and add that home page component to the current home page layout.
<script>
var objectCode = window.top.location.pathname.substring(1,4);
var isedit = window.top.location.pathname.substring(16,18);
var noOverride = window.top.location.search.search('nooverride=1');
if(objectCode == 'objCode' && (isedit == '/e') && noOverride == -1){
var pid = window.top.location.pathname.substring(1,16);
window.top.location = '/apex/VisualforcePage?id='+pid;
}
</script>
in that visualforce page perform proper redirection in action method of page, and redirect page to standard layout by adding nooverride=1 in the url
ex:
http://salesforceInstance/Recordid?nooverride=1
Hope this helps!!
Thanks
No comments:
Post a Comment