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

Announcements

No record found.

News and Announcements icon
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 54

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

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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.

  • Elowy GrootCRM Profile Picture
    54 on at

    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.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Elowy,

    You can check following:

    www.youtube.com/watch

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 192 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans