Tag Archives: Dynamics 365 CRM
Replace OOB Business Closures with a Custom Web Page in Dynamics 365 CRM
Dynamics 365 CRM provides an Out-of-the-Box (OOB) Business Closures feature to define non-working days across your organization. However, in many real-world scenarios, we often face limitations with the default interface in terms of customization, UX/UI control, or extensibility. In this blog post, Iāll Walk you through how you can replace the OOB Business Closures using a custom HTML + CSS + JavaScript web page embedded in Dynamics 365. This custom page will interact with a custom Dataverse table that stores your closure dates and related details. Why Replace the OOB Business Closures? Some of the common limitations of OOB Business Closures: What Weāll Build A custom web resource embedded in a Dynamics 365 CRM dashboard or form tab that: Step-by-Step Implementation 1. Create a Custom Table in Dataverse 2. Create the HTML Web Resource 3. Upload as Web Resource in CRM Benefits of this Approach – Fully customizable UI -Supports additional metadata (reason, region, team) -Extensible for APIs, workflows, Power Automate, etc. -Better UX for users with real-time interactivity To conclude, by using a simple HTML, CSS, and JavaScript front end, we can extend Dynamics 365 CRM to manage business closures in a much more flexible and modern way. It not only overcomes the limitations of the OOB feature but also gives us complete control over the user experience and data model. I hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com.
Enhancing Dynamics 365 Forms with JavaScript: Real-Time Field Visibility and Multi-Select Handling
For businesses using Dynamics 365 CRM, creating a customized and automated user experience is essential for improving efficiency. JavaScript empowers developers to tailor form behavior based on user input or specific business logic, making your CRM highly adaptable. Are you looking to automate form fields and improve usability in Dynamics 365 CRM? This guide will help you understand how to use JavaScript to dynamically control field visibility and behavior. Research shows that 88% of users are more productive with tailored CRM systems. Automating workflows within Dynamics 365 CRM can reduce user errors by up to 70%, streamlining operations and enhancing user satisfaction. Dynamics 365 CRM is highly customizable, and using JavaScript to enhance form behavior can significantly improve operational efficiency and user experience. Automating processes like field visibility and data handling minimizes manual intervention and ensures consistency. At CloudFronts, we have extensive experience implementing Dynamics 365 CRM solutions, tailoring them with custom scripts to meet unique business needs. Through hands-on knowledge, we provide practical insights into achieving optimal CRM configurations. Setting Up Your Dynamics 365 CRM Environment – Go to the CRM main page, click Settings > Advanced Settings. – Select Solutions and create a new solution. – Provide a meaningful name and include the publisher’s name. Develop a Web Resource – After creating the solution, develop a web resource and ensure your code is included in it. – After writing the code, upload the JavaScript and save it as a web resource in make.powerapps.com. Write your JavaScript code Weāll look at two key functions in the provided code: toggleExchangeReturnField and onChangeExhReturnItem. Let’s break them down. Key JavaScript Functions in Action Function 1: Toggling Fields Based on User Input Toggling Fields Based on the Toggle Control toggleExchangeReturnField: function(executionContext) { var formContext = executionContext.getFormContext(); // Get the form context var toggleField = formContext.getAttribute(“cri_rma”).getValue(); // Get the value of the toggle field if (toggleField == true) { formContext.getControl(“cf_exchangereturnitem”).setVisible(true); // Show the exchange return item field formContext.getControl(“cri_rmatype”).setVisible(true); // Show the return type field } else { formContext.getControl(“cf_exchangereturnitem”).setVisible(false); // Hide the exchange return item field formContext.getControl(“cri_rmatype”).setVisible(false); // Hide the return type field } }, The `//` symbol in JavaScript is used to add comments within the code. Comments are helpful for explaining the logic or purpose of the code, making it easier for others (or even yourself) to understand later. However, including comments is optional and not mandatory. Explanation executionContext.getFormContext(): This function retrieves the form context, which provides access to the formās controls and attributes. formContext.getAttribute(“cri_rma”).getValue(): This gets the current value of the cri_rma field, which is assumed to be a toggle field (a boolean that indicates whether the user has opted for an exchange or return process). formContext.getControl(“cf_exchangereturnitem”).setVisible(true): Based on the value of the cri_rma field, the cf_exchangereturnitem and cri_rmatype fields are either shown or hidden using the setVisible() method. Purpose: This function is designed to hide or show form fields dynamically based on the selection in the toggle field (cri_rma). If the toggle is set to true (i.e., an exchange/return is required), it displays the cf_exchangereturnitem and cri_rmatype fields. Otherwise, these fields are hidden. Purpose: Dynamically show or hide fields based on a toggle field’s value. How it works: Retrieves the toggle field’s value and sets the visibility of dependent fields accordingly. Function 2: Handling Multi-Select Field Changes Handling Changes in the Exchange Return Item Field onChangeExhReturnItem: function(executionContext) { var formContext = executionContext.getFormContext(); // Get the form context var selectedoptions = formContext.getAttribute(‘cf_exchangereturnitem’)?.getSelectedOption(); // Get selected options from the multi-select field var exchangeReturnProductDescription = “”; if (selectedoptions != null) { selectedoptions.forEach(ele => { exchangeReturnProductDescription += ele.text + “,”; // Append the text of selected options }) exchangeReturnProductDescription = exchangeReturnProductDescription.slice(0, -1); // Remove the last comma formContext.getAttribute(‘cf_exchangereturnproduct’).setValue(exchangeReturnProductDescription); // Set the field value with selected options formContext.data.save(); // Save the data } else { formContext.getAttribute(‘cf_exchangereturnproduct’).setValue(null); // Reset the field if no options are selected } } The `//` symbol in JavaScript is used to add comments within the code. Comments are helpful for explaining the logic or purpose of the code, making it easier for others (or even yourself) to understand later. However, including comments is optional and not mandatory. Explanation formContext.getAttribute(‘cf_exchangereturnitem’).getSelectedOption(): This retrieves the selected options from the multi-select field cf_exchangereturnitem. This field likely holds a list of items that the user can select for return or exchange. exchangeReturnProductDescription += ele.text + “,”;: For each selected option, the code concatenates the text (name) of the item with a comma to build a string of product descriptions. formContext.getAttribute(‘cf_exchangereturnproduct’).setValue(exchangeReturnProductDescription): The concatenated string of selected items is then assigned to the cf_exchangereturnproduct field. This could be a text field that lists the products selected for exchange or return. formContext.data.save();: After updating the field, the form data is saved to ensure the changes are persisted. formContext.getAttribute(‘cf_exchangereturnproduct’).setValue(null);: If no items are selected, the field value is reset to null. The most crucial step is to add the lines of code within the field. Above all, we need to ensure that the function is added to the form properties. This process will be demonstrated below. Purpose: Builds a comma-separated list of selected items and updates a designated field. How it works: Gathers user selections and updates the field in real time, saving changes instantly. Final Code for Execution Binding the JavaScript Functions to Form Events – Open the desired form in your solution at make.powerapps.com and select Entities > Forms. – Add the JavaScript web resource to Form Properties. – Under Form Libraries, click Add, select the JavaScript Web Resource you created earlier, and click OK. Bind the toggleExchangeReturnField and onChangeExhReturnItem functions to relevant field events – In the Form Editor, select the field (e.g., a text field or lookup) for which you want to trigger the OnChange event. – In the Field Properties window, go to the Events tab. – Under OnChange, click Add to create a new event handler. – Select the Library … Continue reading Enhancing Dynamics 365 Forms with JavaScript: Real-Time Field Visibility and Multi-Select Handling
Creating an Application User for Dynamics 365 CRM in the Azure Portal and When to Use It
Introduction In Dynamics 365 CRM, integrating with external systems, running automated processes, and developing custom applications often requires non-interactive access to CRM data. One of the most secure and efficient ways to achieve this is by creating an Application User via the Azure Portal. In this blog, weāll guide you through the step-by-step process of setting up an Application User and explain when and why you should use it in your CRM environment. Steps to Create an Application User: – Navigate to the Azure Portal and log in with your Azure account. – Search for Azure Active Directory or select from the left-hand menu. – Click on “App registrations” in the Azure Active Directory blade and click on “New registration”. – Enter the following details: – Click “Register”. – Select the newly created application from the App registrations list and click on “API permissions” in the left-hand menu. – Click on “Add a permission”. – Select “Dynamics CRM”. – Select “Delegated permissions” and check the necessary permissions such as user_impersonation. – Click “Add permissions”. – Click on “Grant admin consent for [your organization]” and confirm. – Go to “Certificates & secrets” in the application settings. – Click on “New client secret”. – Add a description (e.g., “CRM App Secret”) and set an expiry period. – Click “Add”. – Copy the value of the client secret and store it securely. You will need it later. – Add Application User in Dynamics 365 CRM – Log on to the Microsoft Power Platform Admin (D365 Admin) centre as a system administrator. – In the navigation pane, go to Environments, and then select an environment form the list. – On the Settings tab, go to Users + permissions, and then select Application users. – The application users page appears. – Click + New app user. – After clicking on + New app user. A side menu slider will appear. Here you will have to: When to Use an Application User Conclusion Creating an application user in Dynamics 365 CRM via the Azure Portal is a straightforward process that enhances the integration capabilities and automation potential of your CRM environment. By following the steps outlined above, you can set up an application user and leverage it for various integration and automation scenarios. We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com
Customizing the Opportunity Close Dialog Box in Dynamics 365 CRM
Introduction When managing Opportunities in Dynamics 365, the default dialog box for closing an Opportunity as either won or lost often lacks specific fields that may be essential for your business process. Attempting to close an Opportunity as either won or lost, you will encounter the following dialog box with the following options. Curious about customizing this dialog box with additional fields? In this blog, I’ll guide you through customizing your Opportunity Dialog Box when marking it has won or lost. Steps : – Sign in to Classic Dynamics 365 using your URL, such as abc.dynamics.com, and enter your credentials. – Create a Solution and include the out of the box called ‘Opportunity Close’ table/entity. – After adding the table/entity, navigate to the forms section and include the Quick Create form for ‘Opportunity Close’. – Include the fields you need in this Quick Create Form. You can also add your own custom fields. Here, I’ve included the out-of-the-box fields. After making changes, save and then publish. – After saving and publishing your changes, navigate to the model-driven app and choose the app where you wish to incorporate the entity. – When customizing your form in Dynamics 365 the classic way, ensure to remove and re-add the Quick Create form for Opportunity Close in the Model-Driven Apps section. – Ensure that your entity is added, and all forms are included as shown below. Once saved, remember to publish your changes. – Navigate to the Dynamics 365 page and refresh it 2-3 times. You will notice that when you attempt to close the Opportunity as won or lost, the default dialog box will no longer appear. Instead, the custom Quick Create form you created will be displayed. Conclusion Customizing the Opportunity Close dialog box in Dynamics 365 allows you to gather more relevant data at critical stages in the sales process. By following these steps, you can easily modify the default form and include additional fields that align with your organizationās needs. This not only improves data capture but also ensures a more streamlined experience for your sales team. Hopefully, this guide has helped you understand the customization process and enabled you to take advantage of Dynamics 365ās flexibility. We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com
How to Fix the error āāisGlobal information provided True doesnāt match the value stored in DB False.ā in D365 CRM.
Each time I attempt to export a solution from the source environment to another environment, I receive the following notification āisGlobal information provided True doesnāt match the value stored in DB False.ā As a result, importing the solution into the destination environment becomes challenging for the individual. Whenever this kind of error appears, it has to do something with the fields on the form. This happens when you mistakenly make changes in the Production environment instead of making changes in the Developer environment or Vica Versa. Normally, the procedure is to make changes (e.g., Adding fields or any other customizations) in the Developer Environment and then export those changes to the Production Environment. Once those changes are imported into the Production environment, after cross-checking you realize many more fields are to be added. So we started to create and add fields in the Production environment instead of the Dev environment and that is how a mismatch of errors occurs with Fields and thus it gets difficult to export/import a solution in other environments. To avoid this error, below is the blog you can refer to. Step 1: Log in to Power Apps using your credentials. Try to check both your source environment as well as Destination Environment. Step 2: In order to check the same, Go to Solutions and click on Default Solutions. Step 3: Go onto the table/Entity in which you are currently working. In my case, My table/Entity is Students. Step 4: Try to check the latest field which you have added. In my case, the name of the field is Courses Offered. Step 5: Click on Edit table column. Step 6: As you can see, my Destination environment (Production Environment) consists of the below field (Courses Offered), which is a Global option set Field. Step 7: Whereas my Source Environment (Developer Environment) has the same field name called āCourses Offeredā which is an āOption Set fieldā. So, Delete the old option set field from this environment and try again to import this solution to the other environment. Step 8: The Difference between a Global option Set and a normal Option Set is that a global option set can be used globally for all entities/tables. But an option set field can only be used for that specific table. For eg If my entity/table name is āStudentsā. I can only use my option set for that specific entity. Step 9: In order to avoid the error, download that error log and try to open it via Excel and try to rectify all the fields from that Excel sheet via both environments. We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com
How to create a SharePoint site and enable Server-Based SharePoint Integration for Document Management System in D365 CRM
What is a SharePoint site? Sharepoint site is an application which is provided by Microsoft which can be used to store information and content. This may include documents, images videos, tasks, and so many things. For more details please follow the link Steps to create a site and integrate your SharePoint with D365 CRM Step 1: Log in to Office 365 login and open SharePoint. Step 2: Once you click on Sharepoint, go onto the Home icon and click on +Create site. Step 3: Click on Team site. My requirement is to track my project status and to share team resources and co-author content. So thatās why I select the Team site. Step 4: Enter your details for your new site and once done, click on Next. Step 5: You can also add specific members for your site(not necessary). Once done click on Finish. Step 6: Once you click on Finish, it will redirect it to your site which you created. Just copy the above link of your site which I highlighted. Just copy the link to your site. It will be used later. Step 7: Go into Dynamics 365 CRM and login in with your credentials OR mention your URL for e.g. abcde.crm.dynamics.com and then login. Once done, click on the ellipses(3 dots) and select Advanced Settings. Step 8: Drop down the Settings icon and click on Document Management. Step 9: Click on Enable Server-Based Sharepoint Integration. Step 10: In simple terms, what we are doing is integrating and validating the configuration of SharePoint. Click on Next. Step 11: Select Online and then click on Next. Step 12: Enter the URL I previously asked to copy and paste(In Step 6). Paste that link here and click on Next. In the Next Step, it will validate that site. After that click on Finish and wait for 3-4 mins. Step 13: After Refreshing you will observe that Enable Server-Based Sharepoint Integration section has changed to One Note Integration. This means that your SharePoint has been enabled and whatās remaining is to add the entities which need to be stored in Sharepoint. Step 14: In Order to do that, click on Document Management Settings. Step 15: Select the entities which you want to enable for the Document Management System. Step 16: If you want a folder structure based on a certain entity you can check the option Based on entity and select the entity you want. Step 17: Click OK to continue. Step 18: FYI the status is showing me cancelled since I have already created the document management system for these selected entities previously. In your case, the status will show completed if you are doing it for the first time. Step 19: Go onto your SharePoint site and click on Site contents Step 20: Here you can view all the entities which were selected for the Document Management System. Hope this Helps!!!
How to Use Solution Checker to identify usage of the OrganisationData.svc endpoint (Odata Deprecation for Web resources)
The Organization Data Service is an OData v2.0 endpoint introduced with Dynamics CRM 2011. The Organization Data Service was deprecated with Dynamics 365 Customer Engagement v8.0 in favor of the Web API, an OData v4.0 service. For more details please follow the link https://powerapps.microsoft.com/en-gb/blog/odata-v2-0-service-removal-date-announcement/ OData v2.0 Service removal date announcement | Microsoft Power Apps To determine the deprecation in your old javascripts below is the blog you can refer to. Step 1: Log in to the required Power Apps environment using the URL make.powerapps.com by providing a username and password and select your environment accordingly. Step 2: Go onto Solutions and click on [+ New solution] from the menu bar Step 3: Name your Solution and fill in all the details which include the Publisher as well as the Version details. Step 4: Go inside your solution and select Add existing option. Click on More and select Web resource. Step 5: Search for your web resources using your custom publisher. For example, your publisher might be new_ or abc_ and so on.It depends on how you name your publisher. Step 6: Select all the web resources you required and once done, go back to the solution and click on the ellipses(3 dots) of your solution. Click on the option Solution checker and select Run. Step 7: We can also view the Run Status of the solution. Step 8: Click on Ellipses(3 dots) again of the solution you have worked on and click on Solution checker and then you can view the option Download results. Click on that option and once you download it, it will be downloaded in the form of xlsv(excel). Try searching the issue for web-avoid-crm2011-service-data on that excel sheet. Hope this helps!!!
Set multiple not resolved Email Ids as To Party CC Party & Bcc Party in D365 Email Message records using Cloud flows
Many a time it happens that we need to send emails that may be an email notification etc. to clients, with the power automate capabilities we can schedule, trigger, manually run, and do want not to automate these notification emails. But the road blocker to all of these is not resolved email IDs, i.e. email IDs that cannot be resolved as Contacts, Accounts, Users in CRM. We need to make changes to system settings to allow messages to these unresolved Id we have already covered this in the Blog : [https://www.cloudfronts.com/power-automate/send-email-to-not-resolved-email-ids-from-workflow-cloud-flows/] In this blog let’s see how we can set multiple not resolved Email Ids as To Party CC Party & Bcc Party in D365 Email Message records using Cloud flows ToParty, CCParty, BccParty are all Activity Parties and they have a ParticipationTypeMask integer value associated with them more on Activity Parties and Types in this link [https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/activityparty-entity?view=op-9-1] ParticipationTypeMasks are as below : Sender : 1 ToRecipient: 2 CCRecipient: 3 BccRecipient: 4 In Cloud flow create a new email record, click on āSwitch to Input entire arrayā, populate the email in the address used field and ParticipationTypeMasks as shown below : Hope this helps! Thank you
Making Managed fields required dynamically in Dynamics 365
On some instances, there are Managed fields in Dynamics 365 CRM (or CE if you want to call it) where we can’t change the required level of the field from Fields i.e. on the database level. And you get the below error – Here’s an alternative way to do it. Scenario Let’s consider this scenario. Although Microsoft suggests you don’t change the behavior of Managed fields since they are designed with a purpose. However, let’s consider this scenario where you want to make the Parent Account for Lead as required on the form.When you try to change the Requirement Level as follows And while saving this change, you get this error. So how do we do it? Let’s see. Workaround – Business Rule Now, to overcome this particular scenario you can implement a simple Business Rule to make it required as follows – If the field can’t be made Required on a database level, you can make it required on the form using Business Rule. Here’s how you create your Business Rule.As the Business Rule starts with the condition, here’s the check you need to add in case the field value is not entered. The condition I used is as below – Check if Parent Account for lead Does Not Contain Data If this is True, then go ahead and add a Step for True condition. Add Set Business Requirement Level And in this, you need to set the Business Required Status to Business Required as show below. And the result is the Business Rule which looks like in #1 above. Now, save your changes, Publish the Rule, Activate and check. The result will be that the field is not required once it doesn’t have data forcing the user to enter data for the same. Hope this is helpful!
Letās get started with Azure Function for Dynamics 365 CRM: Part 1
In this blog, we will learn how to create an Azure Function App to connect it with Dynamics 365 CRM and perform the CRUD operation in Dynamics 365 CRM. First, we will create an Azure Function project for Dynamics 365 CRM from Visual Studio, and below are the steps for the same. Open Visual Studio and create a new Azure Function Project. Filter platform as Azure, select Azure Function, and click on Next. Name your project and click on Create button. After clicking on Create, you will get the below screen where you need to select the Trigger and Azure Function v1 (.Net Framework) and click on Create. In my case, the Azure Function trigger will be Http Trigger which means when an azure function will receive an HTTP request it will trigger. Your Azure Project will be created and the following will be the structure of the project. Now, we will create Azure Function to connect with the Dynamics 365 CRM we need to add the required NuGet Package [Microsoft.CrmSdk.CoreAssemblies]. To add the NuGet Package right-click on the Project and click on Manage Nuget packages. Add Microsoft.CrmSdk.CoreAssemblies in your Project. Following is the code to connect the Dynamics 365 CRM. Currently, we are going to use the credential by specifying them in the C# Code or you can use it as constant. Later in the series, we will learn how to use Environment Variable and pass the credential more secure way in Azure Function using Azure Key Vault. [Stay tuned..!!] Now, select the code and Refactor the code and make the connection function that will return the IOrganizationService if the connection is established else return null. Now, the final code will be as below: Now, we will create a customer with a Hardcoded name when the function is triggered with an HTTP request. Update the existing code with the below code: Testing: We will require the API testing tool, here I am using Postman and the following is the link to download āPostmanā. https://www.postman.com/downloads/ To test the application, click on the Start button on top of Navbar as mentioned below in the screenshot [Button will have Project Name]. It will take a few minutes to Load the Azure Emulator Following is the screen you will be able to see and copy the URL highlighted in the red below and paste that URL in Postman. Open the Postman and click on the create a new tab; Select request as POST and paste the URL: After pasting the URL, click on Send You will get the following response on the Azure Function Tool and Postman If there any error or issue with the Azure Function code, the request will be failed and will be displayed on both Azure Function Tool and Postman [Status will be ā4**ā or ā5**ā ] Now, we will take look at Dynamics 365 CRM environment and check whether the account is created or not. We are justing getting started with Azure Function for Dynamics 365 CRM and stay tuned for more in this series. Upcoming blogs 1. How to use Dynamics 365 Credentials securely using Azures Function. 2. How to create Dynamics 365 integration with Third-party Applications. Many moreā¦ā¦