Simplifying System Settings Management 

Simplifying System Settings Management

Kerv Digital

Kerv Digital

The Digital Transformation Arm of Kerv Group|Kerv Digital

Published 20/07/23 under:

Have a question?

Get in touch

Managing system settings in complex projects can be a daunting task, especially when the requirements mean for multiple changes to default configurations.  As with any complicated process, we can streamline the approach to handling system settings, while also focusing on the organization entity. In this blog, Kerv DevSecOps Engineer, Dan Styles, will take you through a method that ensures ease of consistency across different environments and allows for a competent solution to an intricate process.  

The journey began with a project where constant changes to defaults were needed, leading to frustration. After some research and a helpful article by Craig Seymour on the cloudThing website, a better way to manage system settings emerged. By leveraging PowerShell and Dynamics WebAPI, this process can be easily incorporated into your workflow to eliminate the need for manual configurations. 

In the development environment, the first step involves manually adjusting the system settings as required. Once these changes are in place, a PowerShell script comes into play. The script utilizes the Dynamics WebAPI to retrieve the organization entity and fetches all relevant properties. However, not all properties can or should be replicated to other environments. To ensure that only the necessary settings are included, properties like “@odata.etag,” “createdon,” “organizationid,” “createdby,” and more are excluded from the list. By filtering and selecting only the properties with non-null or non-empty values, the script creates a JSON file that will serve as the blueprint for the settings to be replicated. 

While JSON is a powerful format, certain limitations arise when handling datetime objects and OptionSetValues (picklist fields). To overcome this hurdle, a plaintext list of datetime fields and picklist fields is referenced. These references are well-documented on the Microsoft website and provide a reliable solution for these specific data types. 

During deployment, the PowerShell script constructs a hashtable to store the settings from the JSON file. Looping through the JSON, the script adds field names and values to the hashtable. When encountering datetime fields, the script converts the value to a datetime object. Similarly, when encountering picklist fields, the appropriate conversion to a New-CrmOptionSetValue is performed. This ensures that all settings are appropriately mapped and retained during the deployment process. 

Once the hashtable contains all the necessary orgSettings, the final step involves iterating through the hashtable and applying the settings to the organization entity. This is achieved through the use of Set-CrmRecord, which enables seamless updates to the specified entity. 

In essence, this streamlined approach simplifies the management of system settings, ensuring that developers and administrators no longer need to manually configure each environment separately. With the use of PowerShell, Dynamics WebAPI, and the ingenious hashtable technique, the process becomes efficient, consistent, and easily scalable for large-scale projects. 

To sum all of this up, the systematic handling of system settings through the organization entity brings significant benefits to any development or system administration project. By eliminating the need for repetitive manual configurations, it saves valuable time and minimizes the chances of human error. Developers can now focus on more critical aspects of their projects while maintaining a consistent and reliable configuration across various environments. For seamless integration and execution of the outlined approach, the Microsoft.Xrm.Data.PowerShell module by Sean McNellis is a valuable asset. Whether you are a seasoned developer or just starting, adopting this method can revolutionize your system settings management and enhance overall productivity. 

Simplifying System Settings Management 

Related

You might also be interested in

From our world to yours

Kerv Digital Events: Nonprofit Marketing Journey & Customer Insights Live Demo

From our world to yours

The Role of AI in Government: Driving Operational Costs Down Whilst Improving...

From our world to yours

Sustainability, Social Impact and Technology Procurement in the Transport Sector  

From our world to yours

The Kerv and Genesys Partnership goes from Strength to Strength

From our world to yours

How BPOs can automate with care

From our world to yours

Focusing on employee engagement and performance matters

From our world to yours

Compliance Cloud: Overview & demonstrations

From our world to yours

Life at Kerv as a People Partner

From our world to yours

Unveiling The Latest Advancements: Microsoft Dynamics 365 – Release Wave 2

From our world to yours

4 Steps To Building A Compliance Solution

From our world to yours

Kerv is officially one of the UK’s Best Workplaces in Tech!

From our world to yours

Supporting Supporters: How Nonprofits Can Plan For The Future

From our world to yours

GoodShape Raises the Bar for Member Experience, Call Quality, & Compliance

From our world to yours

Qualitas: How small businesses coming together can aid GP practices

From our world to yours

Capacity vs Capability

From our world to yours

CV Library: How strong leadership focused on IT can be a vital...

From our world to yours

Microsoft Teams Telephony

From our world to yours

Voxivo4Teams Cloud Voice Solution

From our world to yours

Microsoft Teams Rooms

From our world to yours

What is Azure Arc?

From our world to yours

Delivering a platform to underpin Fotech’s rapid growth plans

From our world to yours

What is Shadow IT?

From our world to yours

The Low Code/No Code Canvas

From our world to yours

How Buckinghamshire NHS Trust sped up their service

From our world to yours

Capitalise on the Cloud Opportunity

Have a question?

Leave your details and a member of the team will be in touch to help.

"*" indicates required fields

By pressing send, you agree to our Terms and Conditions and Privacy Policy.
This field is for validation purposes and should be left unchanged.