مشاركة عبر


clearGlobalNotification (مرجع واجهة برمجة تطبيقات العميل)

مسح إعلام في التطبيق.

بناء الجملة

Xrm.App.clearGlobalNotification(uniqueId).then(successCallback, errorCallback);

المعلمات

الاسم نوع مطلوبة ‏‏الوصف
uniqueId سلسلة ‏‏نعم‬ المعرف الذي يجب استخدامه لمسح إعلام معين تم تعيينه باستخدام addGlobalNotification.
successCallback الدالة لا. دالة لاستدعاء عند مسح الإعلام.
errorCallback الدالة لا. وظيفة للاتصال عند فشل العملية.

قيمة الإرجاع

عند النجاح، ترجع عنصر وعد.

الأمثلة

يوضح المثال التالي كيفية إضافة إعلام ثم إغلاقه تلقائيا بعد 5 ثوان.

// define notification object
var notification = 
{
  type: 2,
  level: 3, //warning
  message: "Test warning notification"
}

Xrm.App.addGlobalNotification(notification).then(
    function success(result) {
        console.log("Notification created with ID: " + result);

    // Wait for 5 seconds and then clear the notification
    window.setTimeout(function () { 
            Xrm.App.clearGlobalNotification(result); }, 5000);
    },
    function (error) {
        console.log(error.message);
        // handle error conditions
    }
);

إضافةGlobalNotification