Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Manipulate Background Colors in onLoad Form Web Resource

Jump to Best Answer
  • 1.  Manipulate Background Colors in onLoad Form Web Resource

    Posted 18 days ago
    Customers want background colors on their option sets, dates, etc. on
    Dynamics 365 forms. All documentation says "document.getElementById"/ jQuery is not supported in form scripts.

    I am looking for a way to do this through Client API. However, I am having a hard time finding. Also, I keep getting null on any "document.getElementById" that I attempt.

    I need to make a case there is currently no way to do this out-of-the-box using the client API. If there is a way, please advise.

    Thanks.

    ------------------------------
    Rodrick Hales
    Vertex Aerospace
    Madison
    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: Manipulate Background Colors in onLoad Form Web Resource
    Best Answer

    GOLD CONTRIBUTOR
    Posted 17 days ago
    Rodrick,

    I doubt anyone is going to encourage you to access the DOM but I don't see why you couldn't develop custom controls for each field you wanted to customize.  The official documentation is fairly helpful and you can visit the PCF gallery for other examples.  Just be warned there are a number of blog posts with outdated information but the basics haven't changed much.

    Regards,

    Bob


    ------------------------------
    Bob Chang
    CRM Application Developer
    Cystic Fibrosis Foundation
    Bethesda MD
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 3.  RE: Manipulate Background Colors in onLoad Form Web Resource

    Posted 17 days ago
    Thanks for your response Bob. Apparently, these are things we see that we rarely get to explore because it changes so fast.

    I will take a look at this. I just want to be sure I can use this in Dynamics 365 and not just PowerApps before I get started.

    ------------------------------
    Rodrick Hales
    Vertex Aerospace
    Madison
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 4.  RE: Manipulate Background Colors in onLoad Form Web Resource

    Posted 17 days ago
    Thanks for your response Bob. Apparently, these are things we see that we rarely get to explore because it changes so fast.

    I will take a look at this. I just want to be sure I can use this in Dynamics 365 and not just PowerApps before I get started.

    ------------------------------
    Rodrick Hales
    Vertex Aerospace
    Madison
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 5.  RE: Manipulate Background Colors in onLoad Form Web Resource

    SILVER CONTRIBUTOR
    Posted 16 days ago
    Accessing the DOM has always been unsupported.  Yes, we used to do it but with the new UI and support for multiple browsers totally fraught with danger.

    Pete

    ------------------------------
    Peter Hale
    Naish Pty Ltd
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role