Category Archives: Dynamics CRM
Get/Read Selected Record Information From Main View Or A Sub-Grid using Ribbon Workbench In D365 CRM
There is a common application of getting selected records information while working with custom buttons using Ribbon Workbench. Use Case: We had a requirement, where we needed the information of the all selected records from the Main View and Sub-Grid of an entity. We can achieve in Ribbon Workbench. Steps: 1. The button on which we are customizing is named as “Submit”. 2. In the Command section, click on “Actions” -> “Javascript Action” to add Custom Javascript. Then click on “Add Parameter” -> Click on “Crm Parameter” -> then on SelectedControlSelecteItemReferences. SelectedControlSelecteItemReferences = grabs the information of all selected record from the view. 3. SelectedControlSelecteItemReferences will pass the information of all the selected records in my “selectedItems” variable passed to the method. 4. On clicking the Submit Button, the selected records information will be passed on to the Javascript Code. 5. On clicking the “Submit” button, it will pass the two selected records information to the method that the button is calling. 6. You can further read all the information from the Array and perform the actions that you want. Note: This can be done in Sub-grids of the forms also. Conclusion: Hope this blog helps to get/read the selected Information from the Main View or Sub-Grid
Share Story :
Create and Populate Word Template Using Power Automate
Introduction: We are aware of dynamics 365 CRM’s Document template functionality. However document templates do not need XML Mapping which limit the fields that we can populate in template. SO here’s a way to use Power Automate and SharePoint and implement the Document template functionality. Steps: Create Word Template with content controls and Upload to SharePoint. Enable the Developer tab and click on Design Mode. From the available controls add the Content controls, repeating controls(For data table). Click on properties and add title, tag. Once done save the word and upload to SharePoint. In you Power Automate (You can trigger the power automate as per your requirements). Action 1: Get File Content. Site Address: your SharePoint link File Identifier: Your uploaded document template. Action2: Populate a Microsoft Word Template. Location: SharePoint Location. Document Library: Share Point Site Contents. File: Your uploaded document template. Content control: the content controls from your template will be visible here. Action 3: Create file. File Name: Should end with .docx File Content: will be the populated word template. Conclusion: Thus when your power automate runs, a Document will be created in SharePoint from the document template. It is easy to populate a Content control, to know about how to populate a repeating control- check my blog. Populate Repeating Control of Word Template using Power Automate.
Share Story :
Populate Repeating Control of Word Template using Power Automate
Introduction: Power Automate makes it easy to populate word template, we can have table (Repeating control) that can be populated using Power Automate, For information on how to create and Populate Word Template- Refer my Blog: Create and Populate Word Template Using Power Automate Steps: Create a table and add content controls for each cell. After adding content controls, select the entire row and add repeating control. In Power Automate initialize an array Variable, Use append to array action and create the table you wish to populate in the Word Template. Note: Value for the array variable will be {“title in content control properties” : “actual value”} In Action populate the word template, you will see repeating control, Change the form to accept an array input, by clicking on the symbol highlighted in below screenshot. Now Add your array as input in populate word template action. Conclusion: You can populate any of your CRM Data to Word Template by using Power Automate.
Share Story :
Get Stage Id of Business Process Flow Stages
Introduction: I had a requirement where I needed to compare the Active Stage of Business Process Flow to perform an action of the Stage was Develop The Flow trigger body provided the active stage id which I had to compare with Stage id of Develop. However, I did not know the stage id, so I used the below API to get the stage details. Solution: API Query- https://CRMURL.dynamics.com/api/data/v9.0/processstages?$select=stagename&$filter=processid/workflowid eq BPFGuid Example: Get the GUID of Business Process Flow whose stage details you need. Replace below Query with Your CRM URL and BPF GUID. https://Test130.crm.dynamics.com/api/data/v9.0/processstages?$select=stagename&$filter=processid/workflowid eq 9128E4D1-1234-4852-ABD0-A63A6ECA5C5D Output:
Share Story :
Set Name Format In D365 CRM
Introduction: In some scenarios, we might need that Full name of Contact Person should be Last Name and then First Name. In this blog we will see how to change the Format of Full Name for Contact Entity. Step 1: Go to Advanced settings -> Administration -> System settings Step 2: Open System settings -> you will see Option to select different Name format -> Select Format you want and click OK. Step 3: here is the short Demo: I have created a Contact with First Name as Jon and last Name as Paul Below is the Output: Note : This can not be exported into Solution. I hope this blog will help you to format Contact’s Name
Share Story :
Change colour of selected record of the Grid
Introduction: In this blog, we will learn how to change the colour of selected record of the Grid. Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking any record, it should get highlighted. Steps: There is a Screen on which there a Editable grid of custom Entity Objective. To Create an Editable Grid refer to the following link. https://www.cloudfronts.com/create-an-editable-grid-view-in-powerapps/ To add Lookup Fields in the Grid refer to the following link. https://www.cloudfronts.com/add-lookup-fields-in-an-editable-grid-using-powerapps/ This is the grid without highlighting any record. To change the colour of selected records, update the TemplateFill Property: TemplateFill property of the Deactivate Button: Set Gallery.TemplateFill = If( <Guid of record> = <Selected Record GUID>, Color, Color ) For eg: BrowseGalleryObjectives.TemplateFill= If( Objective = BrowseGalleryObjectives.Selected.Objective, RGBA(220, 231, 238, 1), RGBA(0,0,0,0) ) This is the grid with highlighting record. Conclusion: Hope above Blog helps you change the colour of selected record of the Grid.
Share Story :
[Solved] Date Field Shows Wrong Date in Power Automate
Introduction: We recently noticed the Power Automate Trigger body showing a date prior to the date selected in CRM. This behavior was not expected because the field was set to Date Only and so the time zone would not cause this problem. However, after discussion we found that : The behavior of field was set to User Local and so when this field will be set it will be seen as per the user time zone settings as Power Automate processes the Date in UTC Format. All existing date/time fields in CRM are set as User Local by default. Given below are the two approaches by which we can get the proper date in Power Automate. Approach 1: Create a new field in CRM with Format and Behavior set to Date Only. The date for this field will be correctly captured by trigger in power automate. Approach 2: Create a formula in Power Automate to add 1 day to the date coming from CRM, using add days expression. Adddays(parameter from which date is coming from, number of days to add, format of date[optional]) Eg: addDays(triggerBody()?[‘Fieldnamexyz’],1) Conclusion : The above workaround can help rectify the Date in Power Automate.
Share Story :
Enable Record as Active or Inactive record in PowerApps
Introduction: In this blog, we will learn how to Enable multiple records as active or inactive record. Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking the Deactivate or Active Button on top of the Grid, it should Deactivate every record which is selected through the checkbox which is there on every record of the Grid. Steps: There is a Screen on which there a Editable grid of custom Entity Objective. To Create an Editable Grid refer to the following link. To add Lookup Fields in the Grid refer to the following link. This is the grid with a checkbox. To Deactivate or Activate selected records, first create a Collection: OnSelect property of the Deactivate Button: When we select the Deactivate Button, it will collect all the records where the Checkbox is selected. To Deactivate the records from the CDS, set the OnSelect property of the Deactivate Button to the following formula: OnSelect property of the Deactivate Button: Combine the Whole formula in the OnSelect property of Deactivate Button : For eg: DeactivateSelectedRecord.OnSelect = Note: For Activating the record just replace the Inactive to Active in the Patch Formula Conclusion: Hope above Blog helps you Activate, Deactivate multiple records of CDS from the Grid.
Share Story :
[Solved] Resource not found for the segment in Power Automate
Introduction: Using Common data service(Current environment) connector to create a record, if we are trying to populate lookup field we might get the below error message. Solution: When you use the current environment connector. To populate a look up field, we need to specify the plural name of the entity and then the record GUID. Eg: opportunities(GUID). If we use the below approach, we will get the error Resource not found for the segment. Use the below method to resolve the same.
Share Story :
Send D365 Email Using Power Automate
Introduction: Searching Power Automate connectors for Send Email Step available in Workflow? Follow the below steps to send Email from Power Automate . 1)Go to Common Data Service(Current Environment)Connector. Select Create a new record, Entity: Email Messages Add Activity Party Attributes, Email Body, Subject and set regarding. 2) Once Draft Email is ready, add Action Perform a bound action from Common Data Service( Current Environment)Connector. Entity name – Email Message Action name – Send Email Item ID – This will be the GUID (unique ID) of the record to send. (Note: Here, we will provide the Email message ID of the Draft email created in Step 1. IssueSend – This is a No/Yes option list. Set this to “yes” for the email to send. Conclusion: We can replicate the Send Email functionality of Workflows in Power Automate easily.