Git Product home page Git Product logo

Comments (6)

PaulNieuwelaar avatar PaulNieuwelaar commented on June 16, 2024

Hi, I just tested this in an online trial, and it's working OK for me.

image

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.

Sagar486 avatar Sagar486 commented on June 16, 2024

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.

PaulNieuwelaar avatar PaulNieuwelaar commented on June 16, 2024

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.

Sagar486 avatar Sagar486 commented on June 16, 2024

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.

PaulNieuwelaar avatar PaulNieuwelaar commented on June 16, 2024

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.

Sagar486 avatar Sagar486 commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.