Re: Removing standard Buttons in Tool Bar by Matt
Matt
Fri Dec 17 17:48:52 CST 2004
You can by overriding te call it makes to open the form. You can either change
the Javascipt calls or place an override the call. There are a few options.
Just beware that this may backfire though. New Account is called from a number
of places so it will take some time to "override" all the spots.
Matt Parks
MVP - Microsoft CRM
----------------------------------------
----------------------------------------
On Thu, 16 Dec 2004 02:23:03 -0800, Gwendy Pavlovic
<GwendyPavlovic@discussions.microsoft.com> wrote:
Chris,
is there also a way to remove the "New Account" button above the grid in the
Sales module (when Account is selected from the left nav pane) and replace it
with a custom "New Account" button? I need to do this, because our client
wants to perform some checks before a salesperson can actually insert new
account data.
Thx in advance,
Gwendy Pavlovic
"Chris Rogers" wrote:
> Sebastiano,
>
> Totally unsupported, but effective. Edit /SFA/accts/edit.aspx (after
> making a backup copy!) and place the script below between the </body>
> and </html> tags at the bottom. Developer exercise: Since the
> functions are common to many forms, a better way would be to have them
> defined in a separate file and reference that with a <script
> language="javascript" src="..."></script> element within the <head>,
> then only have the RemoveToolbar* function calls in your end-of-page
> script.
>
> Chris Rogers
> www.CustomerEffective.com
>
>
> <script language="JavaScript">
>
> // sButtonTitle is the exact button title (e.g., "Recalculate" or
> "Look Up Address...").
> // For buttons with icons, add a leading space to sButtonTitle
> (e.g., " Send E-mail").
> function RemoveToolbarButton (sButtonTitle)
> {
> var oToolbarTDElement =
> document.all.mnuBar2.childNodes[0].childNodes[0].childNodes[1];
> var oToolbarItemToRemove;
>
> for (var i = 0; i < oToolbarTDElement.childNodes.length &&
> !oToolbarItemToRemove; i++) {
> if (oToolbarTDElement.childNodes[i].innerText ==
> sButtonTitle)
> oToolbarItemToRemove = oToolbarTDElement.childNodes[i];
> }
>
> if (oToolbarItemToRemove)
> oToolbarTDElement.removeChild(oToolbarItemToRemove);
>
> }
>
> // iSpacerIndex is 0-based (so 0 means the first spacer, ...)
> function RemoveToolbarSpacer (iSpacerIndex)
> {
> var oToolbarTDElement =
> document.all.mnuBar2.childNodes[0].childNodes[0].childNodes[1];
> var iSpacerCount = 0;
> var oToolbarSpacerToRemove;
>
> for (var i = 0; i < oToolbarTDElement.childNodes.length &&
> !oToolbarSpacerToRemove; i++) {
> if (oToolbarTDElement.childNodes[i].outerHTML == "<IMG
> src=\"/_imgs/mnu_hSpacer.gif\">") {
> if (iSpacerCount == iSpacerIndex) {
> // We found the spacer we want to remove.
> oToolbarSpacerToRemove =
> oToolbarTDElement.childNodes[i];
> }
> else {
> // Not there yet.
> iSpacerIndex++;
> }
> }
> }
>
> if (oToolbarSpacerToRemove)
> oToolbarTDElement.removeChild(oToolbarSpacerToRemove);
>
> }
>
> RemoveToolbarButton(" Send E-mail");
> RemoveToolbarSpacer(0); // as it's no longer necessary.
>
> </script>
>
>
> "Sebastiano Castrini" <castrini(remove)@libero.it> wrote in message
> news:#FiH9ltpEHA.3244@tk2msftngp13.phx.gbl:
> > Hi.
> >
> > Is there an (unsupported but effective) way to remove standard buttons
> > in
> > Toolbar (ie the "Send E-mail" button in Account Form")
> >
> > Sebastiano.
>
>