Implements a customisable right-click context menu to all editable form fields withing Sage CRM.
I original wrote this functionality because I was getting tired of manually correcting capitalisation in datafields.
It can be extended by a JavaScript Developer to add other menu items. All of which can be made available to all users or you can specify a list of usernames that will get the context menu served to their browsers.
Here is a custom JavaScript file that can be extended with your own functionality.
Currently implements: -
- Sentence Case
- Title Case
- Proper Case
- Upper Case
- Lower Case
- Clear
- Cancel
-
Decide whether you need to make the context menu available to all users or just a specific list of usernames
-
Login to the Sage CRM Server with local administrative privilages
-
Download the JavaScript file called zInputContextMenu.js to your Desktop.
Please Note: - The filename is prefixed with the letter 'z' to ensure that when Sage CRM loads it's libraries alphabetically it will get to our custom .JS file last. When extending any platform you would be wise to treat the core systems files as a dependency, so by loading it at the end we mitigate any risk of browser loading syntax errors!
-
Make any changes you need to the file and when ready place it in the following location: -
[Base CRM Installation Location]/CRM/WWWRoot/js/custom/
-
In order to make the changes take effect, all users must logout of Sage CRM and then log back in again
Please note: - By making changes to the JavaScript file and if it is already running in a LIVE environment. Users may also have to clear their browser cache
-
The variable called sSpecificUsersOnly is being set on line 2 of the .JS code file. This may need to be changed! By default it is set to '1' which is set to only allow the 'admin' user access to the right-click context menu. This is intentional as a lot of these Sage CRM systems being worked on in LIVE environments. Change this value from '1' to '0' when you want to allow all users access to the context menu
var sSpecificUsersOnly = '1'; // 0 = All CRM users can use the context menu / 1 = Only Specific users can use the context menu
-
Adding the context menu icons as embedded base64 data allows us to not rely on external paths etc... Normal images can easily be converted and implemented into the existing code using an online base64 image converter
If you would like to take a look at my other Projects / Examples please use the following link: - https://julianmummery.github.io