PaulNieuwelaar / alertjs

Dialog Builder allows you to create fully customisable dialogs and popups in Dynamics 365.
https://www.magnetismsolutions.com/our-products/alertjs-alert-popup-for-d365
Other
96 stars 38 forks source link

Alert js is not working on HTML web resource #36

Closed kyilintun2017 closed 3 years ago

kyilintun2017 commented 3 years ago

Hi Paul, I try to use alert.show and Dialog(option).showLoading() function in my html web resource Iframe in D365 CRM.
I can call the function from my html webresource. But the loading message doesn't appear. I try to debug there's no error.

         alert.js version - 3.1.1

     Edit: the scripts were working fine on Ribbon workbench and CRM form.
kyilintun2017 commented 3 years ago

image

var _options = { id: "loading", title: "Processing..." , buttons : [], preventCancel : true, width : 500, height : 120, baseUrl : parent.Xrm.Page.context.getClientUrl() }; new Dialog(_options).showLoading();

the steps go smoothly but no error was given and also nothing shows up.

image

PaulNieuwelaar commented 3 years ago

Hey, when using it in web resources you should include a reference the to alert.css file, just like you're doing to reference the alert.js file.

You can also add a reference to the Xrm global context so you don't need to set the baseUrl. https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/getglobalcontext-clientglobalcontext.js.aspx

kyilintun2017 commented 3 years ago

Hi Paul, Its work I didn't aware about alert.css file thank you.