Wednesday, August 23, 2006

DevToolBar and style.display=none

There is a great tool from MS called the Developer Toolbar. It is great for finding parts of the GUI in CRM that you want to hide or change in some other way. To the download page

For instance, I wanted to block the use of write-in products. There is no security setting to use for this, so what you can do is write protect or hide the write-in product switch in the order view (and in quote and opportunity).

However, there is also a menu item for write-in products and it can't be disabled (as far as I know). So, by first, disabling appmode in web.config (should always be used when developing/customizing) and then accessing the orderform with the direct url: /SFA/salesorder/edit.aspx">http:///SFA/salesorder/edit.aspx you can browse the DOM-tree and will find that the menu item for Write-in products has the id: navWriteInProducts

Then in the onLoad event of Order, you just add the following:
navWriteInProducts.style.display = "none";
which simply removes the item from the menu when loading an order.

This is a simple way to modify items in CRM as long as they have an ID. It is quite common that customers want things to be hidden and defaulted, and this can't be done for some parts of CRM using normal customization. This method doesn't require any coding and will work.

Gustaf

1 comment:

  1. That was a beautifully simplistic fix, thanks! We are integrating to GP and needed to prevent salesmen from using that part of the form. Now if I could just figure out a way to call the form locking function to allow them to call the integration to move the order to GP, but then lock the CRM order.

    ReplyDelete