Category Archives: Dynamics 365
Disable field on Click of Button in D365 CE using JavaScript.
Use Case – One of my requirements is to disable the field on click of button Reopen Project on Project form. Let’s see how we can achieve this. Solution – Create Web resource and add below function: Here my function name is “markFieldsReadOnly“. Create Solution in CRM which contains only a single entity on where we have button called “Reopen Project”. Open same solution in XRM Toolbox -> Ribbon Customization. In Order to get form Context from Ribbon, Pass CRM Parameter – Primary Control Select Library which is your web resource and add Function Name and publish. Hope this helps!
Share Story :
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……
Share Story :
Sign in Error on POS because of Azure AD account is not mapped in D365 Commerce (Retail)
Many customers use Azure Active Directory (Azure AD) to manage user credentials for those services. In those cases, the customers might want to use the same Azure AD account across applications. Before a store worker can use an Azure AD account to sign in to the POS application, the Azure AD account must be associated with that worker. At times you will get an error while sign in POS for employees. Even when you add Associate Existing identity for the worker in HQ. Follow the below steps: Go to Azure portal, Click on Azure active directory. Go to user and select the user Copy the External Sub Identifier. Inside AX HQ, go to Commerce shared parameter Inside Identity Provider, Add azure AD link. Inside relying parties Add user External sub identifier for the same. Inside https://commerce.dynamics.com/auth provide below relying parties. Inside https://commerce.dynamics.com/authcc provide below relying parties. Run 9999 job from Channel database. After full Sync Activate POS again. you will able to sign in successfully. hope this helps!
Share Story :
Change Currency format in D365 Customer Engagement
In this blog we will see how we can change the currency format in D365 CE. We are using the Currency field named Price on Account form and we wanted to price in XX,XX,XXX.XX format Let see how we can achieve this. Solution: Go to Settings and click on Personalization settings. After clicking on Personalization setting, In Set Personal Options click on Format. Click on Customize -> in Number, Digit group change the format as per requirement. After updating click on Apply and Ok. In our requirement, we wanted currency in XX,XX,XXX.XX format on Account Entity. Price field Before Changing – Price field after changing –
Share Story :
How to Import and export Layout designs and receipt format of POS in D365 Commerce (Retail)
Using the POS screen layout designer is a tedious work and very likely you would not want to do this in every environment over and over again. For this particular task of moving POS screen layouts, here are the steps to follow: In Data Management, Click on Export. Add following entity list for POS design and receipt format. POS layout images POS button grid POS button grid buttons POS screen layouts POS screen layout zones POS screen layout button grid zones POS screen layout image zones POS screen layout report zones POS visual profiles Layout sizes RetailTillLayoutConfigurationEntity Receipt format Receipt profile Receipt profile line Export that entity Download package Import POS design and receipt format In Data Management, Click on Import. Click on Add file. Click on Upload and add Select the package file which is export (select in Zip format). Entities will be added. Click on import. Run 1070, 1090 job and refresh the browser link. Hope this helps!
Share Story :
How to Initialize Commerce Scale Unit (cloud) from LCS in D365 Commerce(Retail)
If you’re using a Tier-2 sandbox or production environment that has application version 8.1.2.x or later, you must initialize Commerce Scale Unit before you can use retail channel functionality for point of sale (POS) operations that use Retail Server in the cloud. Initialization will deploy a Commerce Scale Unit (cloud). Prerequisites: Deploy a Tier-2 sandbox or production environment that has application version 8.1.2.x or later. Initialize Commerce Scale Unit as part of a new environment deployment Make sure the headquarters environment is available and not in Maintenance mode. Steps: In LCS, on the environment details page, Click on Manage. Click on initialize Select your region And initialize. Inside HQ, go to channel Database new channel DB created. Add channels inside that new Channel DB. Go to channel, click on channel profile and select that new channel DB. Run 9999 jobs from channel Database. I hope this helps!
Share Story :
Track an Entity record form opening / retrieve activity by system user in Dynamics 365 CRM
If you want to track a user who has opened records of any specific entity then you are on the right blog because today we are going to see how we can do simple customization to track the user activity of who has open which record for how many times. Step 1: Create an Entity to track the log of retrieve activity of the registered entity. Following are fields in the entity to track user activity tracking activity 1. Name — Logical name of Retrieved Entity. 2. Record Id — Record Id of that Retrieved Entity. 3. No of Time Retrieved — Stored number of times a user has retrieved that specific record. Step 2: Create a Plugin to create a Retrieved Log record The record will be created or updated whenever the user opens the entity form to check details and the following is code for the same. Explanation: 1. When the plugin will trigger it will check if the retrieved log of that record is already present or not. 2. If retrieve records is not present it will simply create a log record with the following details a. Name — Type of records which user has opened [Entity] b. Record Id — Record Id of record which user has opened c. User — which the user has opened the record. d. Count = 1 3. If the retrieved record is already existing in the system then it will increment the count of the number of times a user has retrieved that record by 1 so that we can track how many times the same user has open that specific record. Step 3: Register the Plugin on Retrieve of Entity on entities for which you want to add tracking. Retrieve: It will trigger whenever an entity form is open by any user. While registering the new step for the plugin please make sure that Run in User’s Context must be “Calling User” so that we can have a track that which user has opened which record. Note: All security roles which are given to the user should have read, create and update right to “Entity Tracker” Entity. Also, the stage of execution of Plugin and execution mode must be “PostValidation” and “Asynchronous” so that it will not affect any system jobs and it can run in the background process. If you want to track a retrieve activity of opportunity then you just need to register the new step and select Primary Entity as an opportunity as I have already done for Account and Contact. Now, your system is ready to track the user’s entity retrieve activities, and you will see the following records: Using the above record you can create any type of custom charts and put them in your admin dashboard or you can create a Power BI report to track activity. I hope this helps you, if yes please like the blog. And, the next blog will be on the dashboard & charts based on our Entity Tracker records so stay tuned for that!
Share Story :
D365 FO: Different ways to deploy SSRS Reports
There are two ways to deploy the SSRS reports in D365 for finance and operation. The first choice would be to deploy the report directly from Visual Studio. Open the Build menu, click Deploy. Alternatively, in Solution Explorer, right-click the report project and then click Deploy. In Solution Explorer, right-click the report and then click Deploy Lastly, we can deploy the reports using PowerShell. Open Windows PowerShell in Admin mode and execute the below commands as per requirement. For deploying all SSRS reportsK:\AosService\PackagesLocalDirectory\Plugins\AxReportVmRoleStartupTask\DeployAllReportsToSSRS.ps1 -PackageInstallLocation “K:\AosService\PackagesLocalDirectory” For deploying the specific reportK:\AosService\PackagesLocalDirectory\Plugins\AxReportVmRoleStartupTask\DeployAllReportsToSSRS.ps1 -Module ApplicationSuite -ReportName <ReportName> -PackageInstallLocation “K:\AosService\PackagesLocalDirectory”(Replace <ReportName> with required report name such as RetailLabel.Report or *Retail* – this will deploy all reports containing ‘Retail’ in report name)
Share Story :
Autosave quick create a form record on fields change and open the created record
Requirement: The user will create the record from the Quick Create and on change of specific field, the record should automatically save. Whenever the record will be saved it should open the created record. In our scenario, we are going to use the Account Entity. When the user will enter the main phone data in the Account Quick Create Form, the record will automatically save and it will open the created account record. Steps: Go to Default Solution or your customization solution and Open the Quick Create Form from Account Entity 2. Click on the Form Properties to edit the form properties of Account Quick Create Form and add the script on the form. 3. Click on the +New button to add the JavasScript web resources on the form so that you can use the script function on Form Events 4. If you wanted to use an existing Web Resource then you add it or else create new by click on new 5. Create a new Script and add it on form 6. Now, we need to add the event list and bind the calling function to it. To do it click on the + New on Event Listener of Form Properties. Note: Please don’t forget to pass the execution context as the first parameter to the function. 7. We will use formContext.data.save() function to get the created record’s GUID and open entity record using that GUID. Following is code for your reference: 8. Code Explanation: a. quickCreateonSave is a function that is trigger on change of Main phone fields of Account Quick Create. b. When the function is triggered we are using formcontext.data.save to save the save so that we can get the GUID of the recently created record. c. On formcontext.data.save() we can assign two functions — on success and failure as parameter to .then() [Reference] d. On Success, the function will return the following response where you can get the entityType, entity id, and name of the record. e. After getting the entity id and entity type, we can use the open form to open the record as mentioned in the Code. 9. Publish all the customization that you have done on the Account Entity Demo: I hope it helps you guys!!
Share Story :
D365FO – HTTP Error 503. The service is unavailable
Introduction: In this blog, we will see how to resolve HTTP Error 503 – The service is unavailable in Microsoft Dynamics 365 Finance and Operations Details: For resolving these kinds of errors, we have 2 solutions as of now. One is to do from the front end that is LCS and the second is to do from the back-end that is from Visual Studio From LCS: Reset the IIS from the LCS. Steps: 1. Go to LCS, login 2. Select the respective project, full details 3. Go to Maintain -> Restart service 4. Select IIS and confirm it 5. Wait till the service is being restarted From Visual Studio: From the back-end, open the VM and follow the below steps: 1. Login to VM 2. Open the Visual Studio 3. Go to Dynamics 365 tab 4. Click on Restart IIS Express That’s it. Build the project and go to the frontend and check the output how it looks like. Thanks for reading and stay connected with us for more updates!!! Jagdish Solanki | Senior Technical Consultant | CloudFronts Business Empowering Solutions Team “Solving Complex Business Challenges with Microsoft Dynamics 365 & Power Platform”