There are many a times where we want to remove few standard buttons from page layout, but there is no such option to remove such restricted buttons. Few such buttons are …
Following is a solution which will hide “Save & Send Invitation” button on New Event page
STEP1: JAVASCRIPT Code. Create a JS file with below code
window.onload = new function()
{
window.setTimeout(hideBtns,2000);
}
function hideBtns()
{
if(document.getElementsByName(“sendEmail”)[0]!=null)
document.getElementsByName(“sendEmail”)[0].style.display = ‘none’;if(document.getElementsByName(“sendEmail”)[1]!=null)
document.getElementsByName(“sendEmail”)[1].style.display = ‘none’;
}
STEP2: Upload the JS file as a DOCUMENT
STEP3: Create a Home Page Component of type (HTML Area)
<script src=”/servlet/servlet.FileDownload?file=01530000001OcDl”></script>
Here 01530000001OcDl is ID of document created in STEP2
STEP4: Add above created Home page component in your home page layout.
That’s it you are all set, now open New Event and add invitees, automatically the “Save & Send Invitation” button will disappear.
Please note : If you have some functionality which you want to work across all pages or on every form then navigate to Setup then go to Customize->User Interface, check “Show Custom Sidebar Components on All Pages” under the Sidebar section.
excited to see a solution Ive been looking for a while now…tried it carefully step by step, unfortunately save & send update button on events is still there after adding invitees…can you help please, what am I doing wrong?
followed steps, did not remove save&send update button on create events…what am I missing? pls help…
Yeah, this is working, great. I have used this to modify country field into picklist values rather than a free text field. See also this post on the community site.
http://community.salesforce.com/t5/Visualforce-Development/Modify-content-on-standard-new-edit-page-for-accounts/td-p/196319
I did follow through all the steps but save&send update button is still visible on event page for me…
any ideas?
Make sure all double-quotes and single-quotes are standard and not replaced like Word does. Best do this in Notepad.
When you create Home Page Component – make sure you select the Narrow (Left) Column radio-button. When pasting in the script ensure you ticked the Show HTML check-box before pasting. After saving, go back into the component html and check for strange characters. I found a few like %80%9D had been pasted in somehow. Just remove them and re-save.
There will always be the name of the component displayed in the side-menu.
Hi,
Thanks for your post.
I have custom object ‘Prestart_Checklist__c’.
Please tell me what should I replace instead of ‘sendEmail’ according to my custom object.
Hi,
I have a custom object Prestart_Cehcklist__c and I want to hide Save and New button while editing the records.
Please tell me what I need to replace in the above code.
Thanks,
Hi,
Thanks a lot…
It’s working nice, but my query is , if i deployed it to another org, will it work fine or we’ll need to do some changes? (means.. element’s ids may be different)
This is very helpful!
One big problem I am experiencing: “When Show Custom Sidebar Components on All Pages” IS checked related tables are not rendering on any record for any object. I used the exact same code as above.
Any thoughts?
Thanks!
Idea from : Jain Chirag.
Just if this helps who are struggling with this code.
1) Please make sure that when you are adding the script to Home page component. Check show html checkbox.
2) in the same context while adding this script then add this:
where cs4 stands for server on which your salseforce org resides.and 015P00000009IcW is your JS doc id.
This is awesome! I can’t get this to work however. When I try to paste the script above in the html area, it gets stripped out when I try to save the page. Any thoughts on why this is happening?
I would love to get this to work! I don’t know Java or HTML, but I think I’ve been following instructions exactly. But the button still appears. I’m having the same issue as Mia. I paste in with Show HTML checked and save. When I go back to edit, it has disappeared. Also, when I save the .js file from Notepad which encoding should be used?