Monday, 27 March 2017

MS Dynamics 365 CRM referesh composite address field - #JSTip1

I have found a quick hack(dirty way) to refresh composite fields based on other address fields in the form using direct DOM manipulation, below is the sample and explanation.


1. Go to the parent window in the java script
2. Trigger a click on address field which pop's up the address 
3. Close the pop-up which will refresh data.


window.parent.document.getElementById("address1_composite").click()
window.parent.document.getElementsByClassName("ui-widget-overlay-flyout")[0].click()

Note:
Enclose them into a try catch block for soft exit. For closing and reopening the window, use the second statement before calling the first and second statements.

No comments:

Post a Comment