clearGlobalNotification (क्लाइंट API संदर्भ)

ऐप में एक अधिसूचना साफ़ करता है।

सिंटैक्स

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

पैरामीटर्स

नाम Type आवश्य विवरण
uniqueId तार हाँ addGlobalNotification का उपयोग करके सेट की गई किसी विशिष्ट सूचना को साफ़ करने के लिए उपयोग की जाने वाली ID.
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