web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

SweetAlerts2 Not Working

(0) ShareShare
ReportReport
Posted on by 227
Hello,

Everything loads correctly but nothing happens.

I've tried adding this to an onload event or calling via a command bar button.
function callSwal() {
    // Load SweetAlert2 CSS
    var linkElement = document.createElement("link");
    linkElement.rel = "stylesheet";
    linkElement.href = "https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css";
    document.getElementsByTagName("head")[0].appendChild(linkElement);
    // Load SweetAlert2 JS
    var scriptElement = document.createElement("script");
    scriptElement.type = "text/javascript";
    scriptElement.src = "https://cdn.jsdelivr.net/npm/sweetalert2@11";
    document.getElementsByTagName("head")[0].appendChild(linkElement);
    console.log("SweetAlert2 script loaded successfully.");

}

function showAlert() {
    console.log("Swal called")
    Swal.fire({
        title: 'Welcome!',
        text: 'This is a SweetAlert2 popup in Dynamics 365',
        icon: 'info',
        confirmButtonText: 'Cool'

    });
 console.log("Swal shown");
}
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 36 Super User 2025 Season 2

#2
Shivani Padalia Profile Picture

Shivani Padalia 36

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans