Comments (6)
Hi, I just tested this in an online trial, and it's working OK for me.
Can you please give any more context about how you're using it? What version of CRM, which version of Alert.js, and any other related code?
Thanks,
Paul
from alertjs.
Hi Paul,
We are displaying a HTML page in a web resource on the quote form. We have a button on that html page so that on click of that button, we need to open the html page as an overlay (maximize the page) in an Alert.js using Alert.showWebResource. We need to get the Xrm object in that html page to get some data from the quote form and to do some other stuff. When the html is on the quote form we are just doing "window.parent.Xrm", but when the same html page is opened in Alertjs we are not able to find the xrm object (we can get the xrm object by looping through the window.parent.frames but we don't want to do that).
We downloaded and using Alertjs trail version 3.0.7 just for using getCrmWindow() method and using CRM on prem version 8.2.
Please let me know if you need anything else.
Thanks
from alertjs.
Hi, just so I understand, do you have an HTML page embedded into your form, and from within that HTML page, you have a button which called Alert.showWebResource to open another HTML page? If that's the case, in order to get back to the CRM/form context, you'd need to use parent.parent.Alert.getCrmWindow() since the first parent will give you the embedded HTML page.
You can also use window.top.Alert... which will also give you the correct context regardless of how many nested HTML iframes you have.
Hope that helps,
Paul
from alertjs.
Hi Paul,
You understood it right.
Neither parent.parent.Alert nor window.top.Alert are working. Window.top works only when the html page is opened in a new window or new tab.
Thanks,
Sagar
from alertjs.
Hi Sagar,
The 'getCrmWindow' function will return you the window where Alert.js is being loaded in. I'm assuming you are loading the Alert.js file into your first web resource, and then calling Alert.show... directly from there? If this is the case, then getCrmWindow will return you the first iframe/embedded HTML page, since that's where Alert.js is being loaded.
You could try remove the alert.js reference from your first web resource, and load it into the main form libraries, then access the Alert.js reference using parent.Alert from the first web resource. Use that to show the full screen, then use top.Alert.getCrmWindow to get the correct CRM context.
It's a bit of a workaround, but it should work. Let me know how you get on.
Cheers,
Paul
from alertjs.
Hi Paul,
That doesn't work either. Will figure out some other approach.
Really appreciate for your inputs on this. Thank you.
Thanks,
Sagar
from alertjs.
Related Issues (20)
- Popup dialog box useing Alert.js and ribbon workbench HOT 4
- Pass value to Callback function from HTML HOT 3
- question before buying the third version HOT 4
- Alert.showWebResource -404 ERROR HOT 1
- Buttons not working HOT 1
- Unable to call a function inside a webresource from OK button HOT 1
- Use alert.showwebresource to get message from user HOT 9
- Supportability for Unified Interfaace HOT 1
- Alert.showWebResource fail in CRM build 1710 HOT 5
- Alert.showWebResource custom button closing alert HOT 4
- Buttons have no ID optionality HOT 3
- Dynamics CRM 365 (v9) compatibility HOT 7
- Issue with populating lookups in the new Dynamics 365 UCI (Unified Client Interface) HOT 5
- Issue using input fields on UI on Android devices in "portrait mode" HOT 1
- Xrm.Page / formContext HOT 1
- Theme colors HOT 2
- Change font-size issue HOT 2
- TypeScript "Cannot find module" errors HOT 4
- Alert js is not working on HTML web resource HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alertjs.