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,...
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

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 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans