Notifications
Announcements
No record found.
Hello,
I am opening html webresource using xrm.navigation.openwebresource but on closing of html window i want to pass values from html to javascript file from where it is opened . Is there call back function can be implementes ?
If i open html window using window.open i can call parent javascript function using window.opener.functionname on close but click but i want to know how i can pass values to parent javascript file on close button click of html window.
Hi Krishna,
You can do following way.Let say I have a JS library which register in the parent form and having a callback function , let say -
CallbackSetAddress() -
if (typeof (CF) == "undefined") { CF = { __namespace: true }; } CF.Utility = { CallbackSetAddress: function (addressObj) { if (addressObj != null && addressObj != undefined) { Xrm.Page.getAttribute("address1").setValue(addressObj.Address1); } }, _namespace: true };
Now from web Resource access the parent function using window.parent.opener like below-
function OnWebResourceClose() { var selectedAddress = null; selectedAddress["Address1"] = "Line 1"; window.parent.opener.CF.Utility.CallbackSetAddress(selectedAddress); window.close(); }
Hi Gautam,
I have tried as you mentioned but when i tried calling window.parent.opener.updatefields(); getting error as function not defined for updatefields but this function is defined in parent javascript file. please suggest any alternative.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 96 Super User 2025 Season 2
Jimmy Passeti 50 Most Valuable Professional
Gerardo RenterÃa Ga... 49 Most Valuable Professional