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 doesn't work on HTML Web resource #14

Closed afaquezaidi closed 6 years ago

afaquezaidi commented 6 years ago

I am trying to use Alert popup on a HTML Web resource button click event. I have added alert.js script reference on HTML page but its always giving error "Alert is undefined". However I have checked IE developer tool alert.js file is loading. capture_alertjs

PaulNieuwelaar commented 6 years ago

Hi, make sure the alert.js web resource is actually being loaded correctly. I see your other "Scripts" web resource only has one "../" but the alert reference has 2. If that doesn't work, try using the full URL and work your way from there. -Paul

mobaasa commented 6 years ago

i try to call 'showWebResource' function but doesn't work give me the error in the following image, iam already loaded the alert.js on form issuee

PaulNieuwelaar commented 6 years ago

Are other alert js functions working? Looks like the web resource name is incorrect. Can you show the code you're using?

mobaasa commented 6 years ago

OK its work fine, but there are another issue after some of time using alert to show web resource this script error view "One of the scripts for this record has caused an error. For more details, download the log file.ReferenceError: 'showwebresource' is undefined at eval code (eval code:1:1)"

PaulNieuwelaar commented 6 years ago

It should be "showWebResource". Can you post your code?

mobaasa commented 6 years ago

code was working fine but suddenly view this issue "showwebresource" is the name of function function showwebresource() { var baseUrl = Xrm.Page.context.getClientUrl(); Alert.showWebResource("new_TextboxwithLabel", 610, 300, "Enter Number of Items", [new Alert.Button("OK", callback)], baseUrl, true, 30); }

PaulNieuwelaar commented 6 years ago

Looks like the issue is with your outer function. Possibly something you're doing while calling the function?