clearGlobalNotification (חומר עזר עבור API של לקוח)

ניקוי הודעה באפליקציה.

תחביר

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

Parameters

שם Type נדרש תיאור
uniqueId String כן המזהה שבו יש להשתמש כדי לנקות הודעה ספציפית שהוגדרה באמצעות 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
    }
);

addGlobalNotification