I used <a href="https://www.inogic.com/blog/2018/06/show-lookup-dialog-in-dynamics-365-v9-0/" rel="nofollow">this article</a> to open a popup window when clicking on a button in the Lead form. In the onclick event of a button in this popup window, I want to set the value of a field in the parent form. How can I do this in V9, since xrm.page is deprecated? I would like to know the equivalent of
The line above has a value of null in the lead form.
EDIT: in the link posted by Arun in the comment down here, it is written that <em>"although Xrm.Page is deprecated, parent.Xrm.Page will continue to work in case of HTML web resources embedded in forms as this is the only way to access the form context from the HTML web resource."</em>
Since I am opening a popup window, that is not embedded in the form, I can't use parent.Xrm.page. So it is not possible to set a value in thet parent form with a script inside a popup window?Answer1:
You can use
window.opener to do it.