var Severity = { Info: 1, Warning: 2, Error: 3 };
// Disable notifications
function disableNotifications() {
$('.Notifications').parent().parent().hide();
}
function disableNotifications() {
$('.Notifications').parent().parent().hide();
}
// Enable notifications
function enableNotifications() {
$('.Notifications').parent().parent().show();
}
function enableNotifications() {
$('.Notifications').parent().parent().show();
}
// Delete all notificanions
function deleteAllNotifications() {
$('.Notifications').empty();
}
function deleteAllNotifications() {
$('.Notifications').empty();
}
// Set the color of notification area
function setNotificationsColor(color) {
$('.Notifications').css("background-color", color);
}
function setNotificationsColor(color) {
$('.Notifications').css("background-color", color);
}
// Show custom notification
//
// Usage Example
// showNotification(
// 'Error occured<b style="COLOR: #ff0000">Custom Error.</b>',
// Severity.Error);
//
var Severity = { Info: 1, Warning: 2, Error: 3 };
function showNotification(messageHtml, severity) {
//
// Usage Example
// showNotification(
// 'Error occured<b style="COLOR: #ff0000">Custom Error.</b>',
// Severity.Error);
//
var Severity = { Info: 1, Warning: 2, Error: 3 };
function showNotification(messageHtml, severity) {
var css = "ms-crm-ImageStrip-notif_icn_warn16";
switch (severity) {
case 1:
css = "ms-crm-ImageStrip-notif_icn_info16";
break;
case 1:
css = "ms-crm-ImageStrip-notif_icn_info16";
break;
case 2:
css = "ms-crm-ImageStrip-notif_icn_warn16";
break;
css = "ms-crm-ImageStrip-notif_icn_warn16";
break;
case 3:
css = "ms-crm-ImageStrip-notif_icn_crit16";
break;
}
css = "ms-crm-ImageStrip-notif_icn_crit16";
break;
}
var html = '<div id="Notification" class="Notification"> \
<table cellspacing="0" cellpadding="0"> \
<tbody> \
<tr> \
<td valign="top"> \
<img class="' + css + '" alt="" \
src="/_imgs/imagestrips/transparent_spacer.gif"> \
</td> \
<td> \
<span id="Notification_text">'
+ messageHtml +
'</span> \
</td> \
</tr> \
</tbody> \
</table> \
</div>';
<table cellspacing="0" cellpadding="0"> \
<tbody> \
<tr> \
<td valign="top"> \
<img class="' + css + '" alt="" \
src="/_imgs/imagestrips/transparent_spacer.gif"> \
</td> \
<td> \
<span id="Notification_text">'
+ messageHtml +
'</span> \
</td> \
</tr> \
</tbody> \
</table> \
</div>';
$('.Notifications').append(html);
}
}
function AddNotification(strMessage) {
var notificationsList = Sys.Application.findComponent('crmNotifications');
notificationsList.AddNotification('noteId1', 1, 'namespace', strMessage);
}
var notificationsList = Sys.Application.findComponent('crmNotifications');
notificationsList.AddNotification('noteId1', 1, 'namespace', strMessage);
}
var strMessage = Xrm.Page.getAttribute('abcc_cources').getValue()
if (strMessage != "") {
strMessage = "The current Contact is " + strMessage;
AddNotification(strMessage);
}
if (strMessage != "") {
strMessage = "The current Contact is " + strMessage;
AddNotification(strMessage);
}
No comments:
Post a Comment