Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Sweet alert does not work in crm 2016

Posted on by 260

Hi,

I have a form in crm 2015. When it is loaded a sweet alert can be seen in the attachment. The same sweet alert message can't be seen in the form load part in crm 2016 . The code is below. I added "parent." part to the $("") sentences. Because without of parent.  word the javascript code does not work in Crm 2016.

I reed the sweet alert info from here: http://t4t5.github.io/sweetalert/      My problem is: how can i see the sweat alert?

As you can in the form library the below code is in the new_quote_form library. Can anyone help me please?sweet_5F00_alert.jpgsweet_5F00_alert2.jpg

try {
if (sweetAlertCss_Loaded == undefined || sweetAlertCss_Loaded == null) {
alert("içinde");
var _css = "WebResources/new_SweetAlertCss";
var _cssref = document.createElement("link");
_cssref.setAttribute("rel", "stylesheet");
_cssref.setAttribute("type", "text/css");
_cssref.setAttribute("href", _css);
alert(_cssref);
parent.$("head").append(_cssref);
var sweetAlertCss_Loaded = true;
}

swal({
title: 'Teklif veya Direk Satis?',
text: 'Lütfen olusturmak istediginiz kayit türünü seçiniz !',
type: 'warning',
allowEscapeKey: false,
showCancelButton: true,
cancelButtonColor: '#DD6B55',
confirmButtonColor: '#d33',
cancelButtonText: 'Teklif',
confirmButtonText: 'Dogrudan Satis',
closeOnConfirm: false
},
function (isConfirm) {
// isConfirm == true = Siparis else Teklif
getAttr("new_direktsatis").setValue(isConfirm);
getAttr("new_tur").setValue(isConfirm ? 100000001 : 100000000);
if (isConfirm) {
getField("new_uretimtarihi").setRequiredLevel("required");
getField("new_kesinteslimtarihi").setRequiredLevel("required"); //"none", "required", "recommended"
Xrm.Page.getControl("new_uretimtarihi").setVisible(true);
Xrm.Page.getControl("new_kesinteslimtarihi").setVisible(true);
}
if (getField("new_tur").getValue() != 100000001) {
//var elm = document.getElementById("Odeme_d");if (elm) elm.style.display = "none";
hatirlatmaTarihiniAyarla();

toggleTab(false, "tab_odeme");
}
swal.close();
//swal((e) ? 'Dogrudan siparis seçenegi seçildi' : 'Teklif olusturma seçenegi seçildi');
});
} catch (e) { alert("teklifDirekSatisSecimi error:" + e); }

*This post is locked for comments

  • Suggested answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Sweet alert does not work in crm 2016

    In the above code you are calling only the JavaScript libraries. Where are you calling the CSS for the alert.?

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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans