Home > MS CRM 4.0 > Adding custom alert messages in CRM forms (CRM style notification bar)

Adding custom alert messages in CRM forms (CRM style notification bar)


Show CRM style notification bar at entity forms.

document.addNotification = function(img, msg) {
    var parent = document.getElementById("Notifications"
);
    if
(parent) {
        var
count = parent.childNodes.length;
        var html = "<DIV class="Notification" id="Notification"+count+"" Order=""+count+""><TABLE cellSpacing="0" cellPadding="0"><TBODY><TR><TD vAlign="top">"
;
        if (img!=null
)
            html += "<IMG class="ms-crm-Lookup-Item" src=""+img+"" />"
;
        html += "</TD><TD><SPAN id="Notification"+count+"_text"><B style="COLOR: #ff0000">"+msg+"</B></SPAN></TD></TR></TBODY></TABLE></DIV>"
;
        parent.innerHTML+=html;
        parent.style.display="block"
;
    }
}

The first argument is image url. The second is the message text:

document.addNotification("/_imgs/error/notif_icn_warn16.png","This is a test.");

Advertisements
Categories: MS CRM 4.0
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: