Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2023 Release Wave 1Check out the latest updates and new features of Dynamics 365 released from April 2023 through September 2023
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I am creating a control for my Dynamics CRM forms. This control is basically a simple HTML web resource with some JS. In the JS code, I would like to do the following:
As the currentControlName is something that may change depending on who adds it the form, I do not want to hardcode in my resource:
var currentControlName = "WebResource_[a control name]";
Is there a way to automatically determine in which control my JS is running?
Hi sbelzile, you will need to iterate through the controls on the form using Xrm.Page.ui.controls.forEach(delegate function(control, index))..
You can then check the control type and also if it has a particular webresource...
Yes, the obvious alternative... I will try that, thanks for your help.
I found the solution here: stackoverflow.com/.../dynamics-crm-dynamically-getting-html-webresource-parent-control
Business Applications communities