web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Manipulate Inner HTML Web Resource

(0) ShareShare
ReportReport
Posted on by 1,067

Hi, hope you all are doing great today.

Quick question… Is there a supported way to manipulate the inner HTML of a web resource?

Right now I have the following code to change the color and name of certaing HTML components, however, this is unsupported and I'm trying to find a workaround for MS Dynamics 365(UCI):

document.getElementById('segmentation_value').innerHTML = name;

var element = document.getElementsByClassName('div_container');
for (i = 0; i < element.length; i  ) {
    element[i].style.backgroundColor = bannerColor;
}

Thanks in advance!

I have the same question (0)
  • Suggested answer
    Madalina Toma Profile Picture
    on at

    Hello Enrique,

    Based on Microsoft documentation, the usage of DOM elements is not supported, please find the documentation below:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/customizations-supported#common-unsupported-customization-practices

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/supported-customizations#customizations-applied-using-code

    What you can do instead in some situations is the following:

    Try to use an Web resource instead of the Dynamics form where you will use the Web API to get the data you want, or retrieve it directly from the form, but sending it over to the web resource will require some additional work, and define your own visualization from there, preferable without DOM elements, if possible.

    Based on the code you mentioned above you are updating the the color of the container elements and also you use getElementById and getElementByClassName which are not supported in the context of Dynamics.

    I hope this helps.

  • chikhaleankush Profile Picture
    547 on at

    As mentioned in question, the components are inside your HTML created (custom) and method mentioned by you is correct.

    What is not supported, using DOM to manipulate CRM fields and objects. But in your case you are playing under your HTML, so you are fine and it is supported.

  • Suggested answer
    Charles Abi Khirs Profile Picture
    3,569 on at

    Hello,

    You are on the safe side, because you are manipulating the DOM of your own html resource.

    The unsupported way is when you try to access and work with the DOM of the crm forms mainly fields and objects.

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans