Skip to main content

Notifications

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

How to push system format settings to all users?

Posted on by 15
Hi, 
 
Our format settings in the admin center look like this:

 
However our end users still see dates and numbers formatted the American way. It seems that the personal settings of all our end users are different from the system settings. They look like this:



Is there a way we can push the system settings to all end users? I want to avoid having to ask our users to set their personal settings.

Thanks!
  • Jurbe3147 Profile Picture
    Jurbe3147 15 on at
    How to push system format settings to all users?
     
    This worked great, thanks!
  • Jurbe3147 Profile Picture
    Jurbe3147 15 on at
    How to push system format settings to all users?
     
    Thank you for your extensive reply, I appreciate it!

    I'll try it out!
  • Verified answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 8,506 Super User 2024 Season 1 on at
    How to push system format settings to all users?
    To update user personal settings in Dynamics 365 you have 2 opinions.
     
    A) Using Power Automate, you'll need a flow that uses the Microsoft Dataverse connector to update the usersettings entity. Here's how you can build the flow:
     
    Power Automate Flow to Update User Personal Settings
     
    Step 1: Trigger the Flow
    Trigger: Use the Manually trigger a flow action.
     
    Step 2: Fetch the User's Settings
    Action: Use the Dataverse: List rows action.
     
    Table name: usersettings.
    If you need all the rows then just add a simple fetch XML where get all the users or active users only.
     
    If you want specific rows then use filter rows: systemuserid eq 'GUID' (replace 'GUID' with the dynamic value from the trigger input).
     
    This will retrieve the usersettings record for the users.
     
    Step 3: Update the User's Personal Settings
    Action: Use the Dataverse: Update a row action.
    Table name: usersettings.
     
    Row ID: Add the usersettingsid from Step 2.
    Update fields for example as:
    timezonecode: Enter the time zone code from the trigger input.
    uilanguageid: Enter the language code from the trigger input.
     
    Add other fields as required (e.g., date formats, number formats, etc.).
     
    Step 4: Notify Success (Optional)
    Action: Add a Send an email (V2) or Post a message in a Teams channel action to notify administrators of the update.
     
    Example: Update Time Zone and Language Code
     
    Below is an example setup for inputs:
     
    1. Trigger Inputs:
    User GUID = 00000000-0000-0000-0000-000000000000
    Time Zone Code = 190 (e.g., Pacific Standard Time)
    Language Code = 1033 (e.g., English - United States)
     
    2. Filter Row Query:
    systemuserid eq '00000000-0000-0000-0000-000000000000'
     
     
    3. Update Fields:
    timezonecode = 190
    uilanguageid = 1033
     
    Testing the Flow
    1. Trigger the flow manually, providing the necessary inputs.
    2. Check if the user's personal settings are updated in Dynamics 365.
     
     
    B) Using Console.
     
    Here’s a console app in C# that uses the Dataverse Web API to update a user's personal settings in Dynamics 365.
    C# Console Application to Update User Personal Settings
     
    Prerequisites
    1. Dynamics 365 SDK: Install the Microsoft.PowerPlatform.Dataverse.Client NuGet package.
     
    2. Application Registration: Ensure the app has the necessary permissions (e.g., UserSettings.ReadWrite.All) in Azure AD.
     
    Code
     
    using Microsoft.PowerPlatform.Dataverse.Client;
    using Microsoft.Xrm.Sdk;
    using System;
     
    class Program
    {
        static void Main(string[] args)
        {
            // Connection string for Dynamics 365
            string connectionString = "AuthType=OAuth;Url=https://your-org.crm.dynamics.com;ClientId=your-client-id;ClientSecret=your-client-secret;RedirectUri=http://localhost;";
            
            // Initialize ServiceClient
            using (ServiceClient service = new ServiceClient(connectionString))
            {
                if (!service.IsReady)
                {
                    Console.WriteLine("Failed to connect to Dynamics 365. Check your connection details.");
                    return;
                }
     
                Console.WriteLine("Connected to Dynamics 365!");
     
                // User inputs
                Console.Write("Enter the User GUID: ");
                string userId = Console.ReadLine();
     
                Console.Write("Enter Time Zone Code (e.g., 190 for PST): ");
                int timeZoneCode = int.Parse(Console.ReadLine());
     
                Console.Write("Enter Language Code (e.g., 1033 for English - US): ");
                int languageCode = int.Parse(Console.ReadLine());
     
                try
                {
                    // Retrieve the User Settings record
                    var query = new QueryExpression("usersettings")
                    {
                        ColumnSet = new ColumnSet("usersettingsid"),
                        Criteria = new FilterExpression
                        {
                            Conditions =
                            {
                                new ConditionExpression("systemuserid", ConditionOperator.Equal, Guid.Parse(userId))
                            }
                        }
                    };
     
                    EntityCollection results = service.RetrieveMultiple(query);
     
                    if (results.Entities.Count == 0)
                    {
                        Console.WriteLine("User settings not found for the specified User GUID.");
                        return;
                    }
     
                    Entity userSettings = results.Entities[0];
     
                    // Update the user settings
                    userSettings["timezonecode"] = timeZoneCode;
                    userSettings["uilanguageid"] = languageCode;
     
                    service.Update(userSettings);
     
                    Console.WriteLine("User settings updated successfully!");
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Error: {ex.Message}");
                }
            }
        }
    }
     
     
    Steps to Run
     
    1. Replace your-org.crm.dynamics.com, your-client-id, and your-client-secret with your Dynamics 365 environment details.
    2. Compile and run the console application.
    3. Provide the User GUID, Time Zone Code, and Language Code when prompted.
     
    Features
     
    Flexible Input: You can specify the user and settings dynamically at runtime.
     
    Error Handling: Ensures user settings exist before attempting updates.
     
    Customizable: Extend the application to update additional fields as required.
  • Jurbe3147 Profile Picture
    Jurbe3147 15 on at
    How to push system format settings to all users?
    Thanks, I'll look into that.
     
    Are there any alternatives? My organization blocks most of the XRM toolbox tools, so getting access to this one will take some time...
  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    How to push system format settings to all users?
    Hi,
     
    One possible options is to use user setting tool in XrmToolBox, which can be used to update setting for all the users.
     
    Thanks,
    Mahender
    Blog: https://himbap.com/blog
    Please mark as Verified if this answered your question!

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