Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Scripting challenge; change header color based on the open app

Posted on by 491

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
    a33ik 84,323 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
    Elowy GrootCRM 491 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
    a33ik 84,323 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans