THIS PROJECT HAS MOVED TO GITHUB - RIP CODEPLEX, YOU WILL BE MISSED <3

notify.png

Overview

This library gives developers the ability to create nice CRM notifications on forms and views, similar to the Xrm.Page.ui.setFormNotification SDK function, but better!

It gives us all the same functionality as the setFormNotification SDK function, but has the following additional features:
  • Allows you to add buttons and/or hyperlinks into the notification, with custom JavaScript triggered on click.
  • Supports additional icons, including SUCCESS notify_success.png, QUESTION notify_question.png, and LOADING notify_load.gif
  • Supports custom HTML tags to be used manually in the notification message for greater flexibility
  • Ability to manually close a notification using the 'X' on the right hand side
  • Has smooth slide in and out transitions when adding and removing notifications
  • Ability to specify a duration after which that particular notification will disappear
  • Supports displaying notifications inside views from command bar buttons (only in web client - must specify duration)

Check the Documentation page for usage details.

notify_view.png

Add Notification

Adds or overwrites a notification on the custom notification bar. Note that this notification bar is separate to the CRM Notification bar.

Parameters: Message, Icon, Unique ID, Buttons (array), Duration (seconds - optional)

All parameters are technically optional, if there's no icon specified the icon will be removed, if the unique ID is not specified, the ID will be null (and any new notifications with no ID will overwrite that one), the buttons are optional and will display after the message in the order they are added to the array, duration is optional, and if not specified the notification will only disappear if the user manually dismisses it or if other code removes it.

Supported Icon types are: "INFO", "WARNING", "ERROR", "SUCCESS", "QUESTION", "LOADING"

Each button object in the array should have a 'text' to display on the button or hyperlink, a 'callback' function to call when the button or hyperlink is clicked, and optionally a 'type' of 'link' or 'button' (defaults to button if not specified)

Notify.add("Would you like to create a new <b>Sale</b>?", "QUESTION", "sale",
    [{
        type: "button",
        text: "Create Sale",
        callback: function () {
            Notify.add("Sale created successfully!", "SUCCESS", "sale", null, 3);
        }
    },
    {
        type: "link",
        text: "Not now",
        callback: function () {
            Notify.remove("sale");
        }
    }]);

notify2.png

Remove Notification

Removes one or all notifications from the custom notification bar. If an ID of a notification is passed to this function, that notification will be removed. If no ID is passed to this function, all notifications will be removed.

Parameters: Unique ID (optional)

// Remove a single notification
Notify.remove("sale");

// Remove all notifications
Notify.remove();

Created by Paul Nieuwelaar | @paulnz1
Sponsored by Magnetism Solutions - Dynamics CRM Specialists

Last edited Fri at 3:40 AM by Liger, version 12