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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Sweet alert does not work in crm 2016

(0) ShareShare
ReportReport
Posted on by 262

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

I have the same question (0)
  • Suggested answer
    Syed Ibrahim Profile Picture
    6,257 on at

    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

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans