Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Answered

Scripting challenge; change header color based on the open app

Posted on by 476

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,313 Super User on at
    RE: Scripting challenge; change header color based on the open app

    Elowy,

    You can check following:

    www.youtube.com/watch

  • Slowytech Profile Picture
    Slowytech 476 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,313 Super User 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.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans