United Kingdom - D365-CRM

Expand all | Collapse all

UCI - setting DOM properties in JS

  • 1.  UCI - setting DOM properties in JS

    SILVER CONTRIBUTOR
    Posted May 13, 2020 05:52 AM
    Hi UG,

    We are looking to dynamically set the height of an HTML web resource, on load of a form. It didn't work...and neither did hardcoding it:

    window.onload = function () {

    document.getElementById("<name>").style.height = "10px";

    };

    The only conclusion we can draw is that in the new UI, setting DOM properties is no longer possible.

    Would this be correct or are we missing something..?

    #UCI #JS #Javascript ​​​

    ------------------------------
    Tamim Sadikali
    ------------------------------


  • 2.  RE: UCI - setting DOM properties in JS

    GOLD CONTRIBUTOR
    Posted May 14, 2020 02:35 AM
    I think you'll struggle to get advice on this as DOM manipulation is strictly unsupported (no idea if you can do it in UCI either)

    I think your most supported way in UCI would be to turn your web resource into a PCF - this gives you full control over the size on your form and will even allow real time resizing. 

    I think Web Resources have a shelf life and whilst it's far in the future, it's worth investigating the alternatives. 






  • 3.  RE: UCI - setting DOM properties in JS

    SILVER CONTRIBUTOR
    Posted May 14, 2020 09:02 AM
    Thanks, Matt. And good shout re. PCF...I'll take a good look into this.​

    ------------------------------
    Tamim Sadikali
    ------------------------------