Category Archives: Dynamics CRM
Send Email to not resolved Email Ids from Workflow/Cloud flows
Introduction: We might have a requirement to send emails from Workflow/cloud flows to Ids that cannot be resolved as Contacts, Accounts, Users in CRM. Solution: We need to make changes to system settings to allow messages to unresolved recipients In case of Workflow, directly add email address in the field( It will show ? as it is not resolved address) For Cloud flow, in create a new email record, click on “Switch to Input entire array”, populate the email in addressused field. This will let you send emails to an unresolved email address.
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 :
Filter Regarding using JavaScript
Introduction: In this blog we will learn how to filter regarding based on another option set field. Also, we shall understand how we can set the default view for regarding. Solution: The below script will run on field change of “Type”, this is the option set based on which the regarding will be filtered. Regarding: function (execContext) { var formContext = execContext.getFormContext(); if (formContext.getAttribute(“type”).getValue() != null) { Type = formContext.getAttribute(“type”).getValue(); switch (Type) { case 1: formContext.getControl(“regardingobjectid”).setEntityTypes([“contact”]); formContext.getControl(“regardingobjectid”).setDefaultView(“{00000ABC-0000-0000-00BG-000010000147}”); break; case 2: formContext.getControl(“regardingobjectid”).setEntityTypes([“quote”]); formContext.getControl(“regardingobjectid”).setDefaultView(“{00000ABC-0000-0000-00BG-000010000147}”); break; } } } Here, the Entity Type- will be entity you want to show in regarding and default view will be the view whose id is set in this script. Output:
Share Story :
Filter and Set Default Required Attendee using JavaScript
Introduction: Here is JavaScript code that you can use to make the required field show only system user records and also in case you have a requirement to the set the owner of record as default required attendee. Solution: Add below function to your web resource on load event. Conclusion: On load of form the Required attendee will be owner of record and we can add new attendee easily as the dropdown will show only user records. Instead of users, if you need contact records, just change the set entity type-> formContext.getControl(“requiredattendees”).setEntityTypes([“contacts”]);
Share Story :
Update BPF using Power Automate when DocuSign Envelope is sent
Problem Statement: We need to update the BPF and move to the next stage using Power Automate. The change to BPF should happen after the DocuSign Envelope is Sent. In our scenario, DocuSign and CRM are not integrated and so we will be using Power Automate to help us achieve the task. Solution: When DocuSign Envelope is sent, trigger Power Automate by using the DocuSign connector. The Envelope event here will be Sent. Since our DocuSign is not integrated with CRM, we cannot complete the update of Opportunity, until we get the Opportunity ID. As a workaround, we have hidden the Quote Id on the Proposal during generation of proposal. On trigger of Power Automate, we extract the Quote ID from the document. To know more about it, you can refer the blog https://www.cloudfronts.com/close-quote-when-docusign-envelope-is-completed-using-power-automate/ In this blog I have directly saved Opportunity ID in Compose Action. To update the business process flow, we need to get the BPF record as below: List the Business Process Flow for the Opportunity ID. Get the Stage Id to which you want to set your business process flow and store in a Compose action. To know how to get Stage Id, refer my blog https://www.cloudfronts.com/get-stage-id-of-business-process-flow-stages/ Store the path traversed by the Opportunity in Compose. You can use the traversed path directly also. Update the BPF record Set the Active Stage and traversed path. Active Stage= processstages(ID of stage you want to set as active) Traversed Path= concat(existing traversed path,’,’,stage id)
Share Story :
How to bring in Project Task field from Resource Requirements to Time Entries if imported via, Bookings.
Import Bookings is one of the important features provided by PSA for users to do Time Entries quickly and efficiently. An issue faced while using this functionality is the Project Tasks are not imported with the Bookings Records (As Shown in the Image Below). A solution to this issue is two automated flows: To Bring the Project Tasks from Resource Requirements Entity to Bookable Resource Booking. Hence to bring the obtained Project Tasks from Bookable Resource Booking to Time Entries. Let’s Begin with the Implementation of the solution! (Flow To get Project Tasks from Resource Requirements to Bookable Resource Bookings) Step: 1 Bringing Project Tasks from Resource Requirement’s to Bookable Resource Booking. Step: 2 Update the Bookable Recourse Booking Record with the obtained project task. Now we have successfully obtained the Project task in the Bookable Recourse Bookings Entity from the Resource Requirements, Our Next step is to Take this Project task on the Time Entries. (Flow to get Project Task from Bookable Resource Bookings to Time Entries) Step: 1 Bringing Project Task from Bookable Resource bookings to Time Entries. (Tip : It is better to check if the Project Task Field is empty or not hence we can also put a condition to do so, if the Project Task Field is empty proceed with updating the Project Task field else Terminate.) Step: 2 Get the Project Task from the Bookable Recourse Bookings. Step: 3 Update the Time Entries with the obtained Project task. Step: 4 Import Bookings and there you go you will now be able to see the Project Tasks. Hope this Helps!
Share Story :
Hide Tab using JavaScript
Introduction : In this blog we will see how to hide tab using JavaScript. Implementation : Step 1 : Javascript for hiding tab : Step 2 : Upload script on load of form -> ok -> Save and Publish . Result : Hope this helps
Share Story :
Display Month in Text Format Using Power Automate
Introduction: Using Power Automate we can format date in various formats, however we had a requirement to populate date in document in June 10,2020 format. Solution: Here is how to achieve the same. In this example I am formatting the System date which is obtained from function utcnow(). formatDateTime(utcNow(),’MMMM dd, yyyy’) Output: If you do not need to display the full Month in words, you can write “MMM” instead of “MMMM” and get the below output.
Share Story :
Auto-refreshing Views or Grid in D365 CRM
We all know that Views show records based on filter criteria that is applied to the Views. But, what if there is a custom button that will change the records status and according to the Views filter criteria it should not be present in the View. The View should have been Auto-Refreshed. We can achieve this by JavaScript. Use Case: We had a requirement where we wanted to Auto-Refresh the View as soon as the status of record is changed. We have a custom button that will change the status of the selected records but when the Status changes, it doesn’t auto refreshes the View. We had to manually reload the page or click on refresh button on the View. Steps: 1. When the status of the Record changes, you have the id of record then there’s a fully supported way which we can use to Auto-Refresh the View: “refreshParentGrid=Refreshes the parent grid that contains the specified record.” 2. In our case, We had the custom button which changes the status of the record. This is the code: Suppose the custom button is called as “Submit”. On clicking the button it should change the Status and also the records should not be visible in the view as the filter criteria is Status= “In Progress and Rejected” 1. The filter of the View. 2. On clicking the Submit Button, the selected record should not be visible. 3. The View Auto-Refreshed and the selected records are not visible in this View. Note: This can be used in Sub-grids of the forms also. Conclusion: I hope this blog helps you to Auto-Refresh the View.
Share Story :
Connect D365 CRM CDS Database from SQL Server
Many times, we feel like why I can’t access D365 CRM Database directly from MS SQL Server, so here is my blog that will guide you on how you can connect D365 CRM CDS Database using MS SQL Server Steps to enable D365 CRM CDS Database to make it connect from MS SQL Server: Login to https://admin.powerplatform.microsoft.com/ using administrator credentials. In Environment section, click on your environment for which you want to enable D365 CRM CDS for MS SQL Server. (In my case I am clicking on DemoEnvironment as shown below.) When Environment opens click on settings in header. Settings page will open, Click on Product and then click on Features. When features Page opens enable TDS Endpoint (Preview) and click save. Now, we have successfully enabled D365 CRM CDS to connect it from MS SQL Server. Steps to Connect CDS Database from MS SQL Server: Open MS SQL Server. In connect to SQL Server Window enter Server name (It will be your D365 CRM URL) followed by comma and Port Number (5558) e.g. of server name yourdomain.crm.dynamics.com,5558. Select Authentication as Azure Active Directory – Password. Enter Username: Your admin user id e.g. admin@xyz.com Enter Password: (Your Login password) ******** Click Connect. Now, you have successfully connected to D365 CRM DB. Write a select query and test if it’s working.