Hi,
I am looking to display a HTML webresource in the CRM Lead form based on the Location(lookup) field selected. The HTML page called will be different for different locations. Is this possible in CRM?
Thanks.
*This post is locked for comments
Hi,
I am looking to display a HTML webresource in the CRM Lead form based on the Location(lookup) field selected. The HTML page called will be different for different locations. Is this possible in CRM?
Thanks.
*This post is locked for comments
Hi Dinoop,
Write the following javascript code on change of the location (lookup) field.
function ChangeHtmlWebResource() { var webResourceControl = Xrm.Page.getControl("WebResource_Name"); var location = Xrm.Page.getAttribute("locationid").getvalue()[0].name; if (location == "X") { webResourceControl.setSrc(null); webResourceControl.setSrc("XWebresourceURL"); } else if (location == "Y") { webResourceControl.setSrc(null); webResourceControl.setSrc("YWebresourceURL"); } }
Hope this helps.
Hi,
all you need is a javascript event handler - attach it to the "OnLoad" of the form and to the "OnChange" of that lookup field. Then use setSrc method of your iframe control to load the web resource you need:
Xrm.Page.getControl(<control name>).setSrc(<url>)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156