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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Notifiaction popup in CRM 2016 using javascript

(0) ShareShare
ReportReport
Posted on by 262

Hi,

I have 2 servers. One of them contains crm 2015 (live), one of them contains crm 2016 (not online but for testing).

I will arrange the fonctionalities of some custom actions in crm 2016 which is used in crm 2015 using javascript language.

I faced a problem such as in crm 2016 the popup window does not appear. Because i can not append the web resource/css to the head control of the page. My code is below:

function advicequestionSelect() {
try {
if (sweetAlertCss_Loaded == undefined || sweetAlertCss_Loaded == null) {
var _css = "WebResources/new_SweetAlertCss";
var _cssref = document.createElement("link");
_cssref.setAttribute("rel", "stylesheet");
_cssref.setAttribute("type", "text/css");
_cssref.setAttribute("href", _css);
$("head").append(_cssref);//gives me error on crm 2016
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) {

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);
}


}
swal.close();

});
} catch (e) { alert(" error:" + e); }

}

The picture of the popup which i want it seems to be like this below (this is in crm 2015 )
7181.popup.png

Can anyone help me please. How can i do this in crm 2016 using javascirpt.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Use something like this:

    parent.$("head").append(_cssref);

  • altun8tr Profile Picture
    262 on at

    Thanks the error disappered. However the popup window can not be shown. What can i do? Could you please give me any suggestion?

  • Verified answer
    Community Member Profile Picture
    on at

    debug the code. I can't replicate your environment so unable to figure out what is wrong.

    Please mark the answer verified if it helped you

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans