Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Scripting challenge; change header color based on the open app

(0) ShareShare
ReportReport
Posted on by 48

Hi,

My customer has two scripting challenges based on the current open app, maybe someone can help me with this:

  • If possible they want to relate the header background color (.pa-h) to the open app. So each app has its own header background color 
  • They hope the owned team of a newly created account can be filled with the business unit that is related to the open app. To be more clear; they have an app per business unit . So if a user in a parental business unit opens the app and creates an account, it would be great if the owned team can be filled with the business unit team that is related to the open app.

Thanks in advance!

Regards,
Elowy

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Scripting challenge; change header color based on the open app

    Elowy,

    You can check following:

    www.youtube.com/watch

  • Elowy GrootCRM Profile Picture
    48 on at
    RE: Scripting challenge; change header color based on the open app

    Hi Andrew,

    Thanks a lot for your help. You pointed me in the right direction and I got it working right now.

    Although it works, I really think I could use some D365-javascript basics training or videos. Do you have any suggestion?

    Best regards,

    Elowy.

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Scripting challenge; change header color based on the open app

    Hello Elowy,

    So change of header background is doable through DOM/CSS injections but I would not recommend doing it.

    In order to populate the owner you will have to do some scripting:

    Here is the code you can use to define the current application - docs.microsoft.com/.../getcurrentappname

    After that you will have to query for bu, team and populate the owner lookup. To query data I recommend using Xrm.WebApi - docs.microsoft.com/.../xrm-webapi

    Feel free to update the thread with your progress and/or questions.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans