Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Use code to change theme

(0) ShareShare
ReportReport
Posted on by 4,125

Hi,

I tried to update sysuserinfo.theme value to change the user theme (the default color of the system). However even though I change the theme value, but the system still show the original color.

Any idea?

Thanks,

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Use code to change theme

    If you make direct SQL updates in a test system, make sure that the AOS is not running during the update. Otherwise you will have cache issues.

  • Yuji Profile Picture
    4,125 on at
    RE: Use code to change theme

    Hi André,

    Yes, we just want to change all testing environment to use the default theme (0). But it seems even we ran this script in SQL, it did not change the user's default color.

    Thanks,

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Use code to change theme

    Please remember that if you update data via direct SQL (in a system where it's possible), you bypass AOS caching, so the AOS might still use an outdated value for the user.

    If the AOS has SysUserInfo record cached, and it doesn't know that it's updated, it will not make a database call if a session requests that record. But if you update the value via x++, AOS knows that the cached version is outdated and will discard it.

  • André Arnaud de Calavon Profile Picture
    294,781 Super User 2025 Season 1 on at
    RE: Use code to change theme

    Hi Yuji,

    You shared an SQL statement, so I do assume this is not related to a production environment?

    What color(s) are selected now and which color do you want to apply?

  • Yuji Profile Picture
    4,125 on at
    RE: Use code to change theme

    update SYSUSERINFO  set THEME =0

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Use code to change theme

    Do you think you could share your code with us? It would help us identify potential issues in it.

  • Martin Dráb Profile Picture
    233,553 Most Valuable Professional on at
    RE: Use code to change theme

    0 seems to be a valid value, although you should use the enum: SysUserInfoTheme::Theme0.

    Note that it will make no difference if the current value is Theme0 too.

  • Martin Dráb Profile Picture
    233,553 Most Valuable Professional on at
    RE: Use code to change theme

    What color do you expect to get by using 0?

    Also, you missed my other question. If it means that you didn't do either thing, that it's expected that nothing will happen.

  • Yuji Profile Picture
    4,125 on at
    RE: Use code to change theme

    Hi Martin,

    I just set the theme value to 0.

    Thanks,

  • Martin Dráb Profile Picture
    233,553 Most Valuable Professional on at
    RE: Use code to change theme

    What value did you set to the field?

    Did you reload the application or called appl.setTheme()?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 362 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 276

#3
Saalim Ansari Profile Picture

Saalim Ansari 201

Overall leaderboard

Product updates

Dynamics 365 release plans