I want to hide the salutation field from contact layout (Mr, Mrs, Ms). Just First name and last name should be visible. can you please help me with this.
Thanks.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityI got a workaround for this. We can do this via javascript. Please follow the steps below:
• Create a Home Page Component of type HTML Area
• Under Name, give it a name like DOT (.), so that the component does not get displayed.
• Add a JavaScript within the component which gets fired on page load for ex --
<script type="text/javascript">
var str = document.URL; // To fetch Salesforce URL
var edit = str.indexOf("/e?"); // To check if the record is in edit mode
var contactId = str.indexOf("/003"); // to check if the record is a Contact record
if(edit > -1 && contactId > -1 ){ //when user just want to hide the contact standard field only when record is in edit mode
window.onload = function(){
return function(){
if(document.getElementById('--FieldId--') != null){
document.getElementById('--FieldId--').style.display = 'none';
}
}
}();
}
• Now add the component to you Home Page Layout and assign the layout to proper profiles.
I hope this will help. Thanks