Category Archives: Dynamics CRM
“You are not authorized to send mail on behalf of the specified sending account.” – Resolved.
Introduction: We had requirement where we wanted to send Email using Power Automate. We had already implemented this using Work Flow. While implementing this using Power Automate, we started receiving mentioned issue “You are not authorized to send mail on behalf of the specified sending account.” We had similar issue while implementing the same using Work Flow, But it did not work for the Ms Flow, after doing RND we came to know that we need to give permission to send the mail on behalf of another user. Solution : Please follow the below steps to give permission to specific user. Step 1: Go to Admin Center -> Select Exchange Admin Center. Step 2: Click on Recipients and Select User you want to give permission and follow the steps as shown below. Step 3: In this scenario, We wanted to send Email from Admin on behalf of Support User. Below are the Steps to Give the Permission: i. Go to mailbox delegation. ii. Click on the “+” icon and add User from which you want to send Email. In this scenario, we wanted to the send Email by Support. So, add Admin into Send as and Send on behalf and Full Access. ->Save and try to run the flow. Hope this will help you while sending an Email on behalf of the another User.
Share Story :
How to Copy and Paste in Power Automate
Introduction Power Automate has finally got one of the most awaited features. Let me explain it to you. So, if you are willing to deploy similar type of actions inside flow, you had no option but to write each action separately from the beginning. phew! That sounds like lot of work! But now, thanks to Power Automate, flexible solutions have emerged to save time and create better user experiences, which means now you are not required to write each action distinctly every time right from the start, instead just copy and paste actions in Power Automate! Voila! There you go! Copy Click on ellipsis (…) on action which you want to copy or duplicate. Click on “Copy to my clipboard” Paste Click on “Add an action” Go to “My Clipboard” Under My Clipboard you can see all the actions which you have copied. Select the action which you want to paste.
Share Story :
Test Automation on MS Dynamics CRM using TypeScript Library
Nowadays, Test Automation is the most important requirement for any company to check Quality assurance of their product or software. There are very few tools available for Test Automation of MS Dynamics CRM. In this blog, we are going to see how we can do Test Automation using TypeScript Library (D365-UI-Test). It is the opensource library you can edit as per requirement and if any issue is present in the repo you can create an issue on Github Repo. Florian Krönert will resolve the issue as soon as possible. GitHub Repo Link: https://github.com/digitalFlow/D365-UI-Test Setup and Installation: We will use Visual Studio Code because it is a lightweight Code Editor with integrated Git support. And we will require git to clone directory, and we can do operation directly from the VS Code editor itself. Installation Process: First, we will be required D365-UI-Test Source Files So, we need to clone that Repo from GitHub remote GitHub Repo to Local Machine in your working project directory. To open Terminal inside the VS Code use the keyboard shortcut Ctrl + ` In terminal run following git command to clone the directory git clone https://github.com/DigitalFlow/D365-UI-Test.git Now after cloning the repo, we need to install the required Node Packages that are required to run the Project. To Install the required Node Packages, navigate in the project directory in the VS Code and run the following command. npm install “npm install” command will install the required Node Packages with a specific version which will be defined in the “package.json” file. After the installation of all required packages. Now, we can see the sample test cases written in the “TypeScript” in “spec” Folder. To write your own test cases we need to add our test cases and run the Project. Following is the Folder structure of the D365-UI-TEST Project you will get after setup: In the above screenshot, you will able to see the “spec” folder, we can add our own Test Cases but there are some sample test cases available for the UCI “xrm-uci-ui-test.spec.ts” which is written in TypeScript. Now, we must add the settings.txt file in the folder structure so that we can pass the CRM Login Credential to the Test Case File. Or else you can directory pass credential in the Test Case itself. After Adding the setting file, we need to give the relative or absolute path of the Setting file as follows: Following is a test case to login to CRM instance and created the Account Record: To the Run the Open the Integrated Terminal to Visual Studio Code. OR Press Ctrl + ` And Run the following command: npm run test It will run all the tests and show the result as to which test as passed and failed. If the test is failed, then it will show the error of why the test has failed. Once the test is run from the terminal it will open the chromium-browser and start the test. You can see the Documentation of the Library in GitHub or in following mentioned link: https://digitalflow.github.io/D365-UI-Test/
Share Story :
Trigger Power Automate on Condition
Introduction This blog explains how we can trigger Power Automate based on the required condition. Suppose you have a requirement where you want your flow should get trigger based on some condition then you can check condition on “Trigger” itself rather than adding a new action to check condition. Use Case: Trigger flow when Lead is created and Lead Source Type is “Trade Show” Trigger flow when Lead is created and Flag is “Yes”. Trigger Flow when Lead is created, Lead Source Type is “Trade Show” AND Flag is “Yes”. Trigger Flow when Lead is created, Lead Source Type is “Trade Show” OR Flag is “Yes”. Steps to be followed: Trigger flow when Lead is created and Lead Source Type is “Trade Show” Click on Ellipsis (…) –> Click on Settings Go to Trigger Conditions and Click on “+Add” Add condition. @equals(triggerBody()?[‘leadsourcecode’],7) NOTE: “Lead Source” is an option set field add value of that option to check. After adding condition click on Done. Test your flow. Trigger flow when Lead is created and Flag is “Yes”. Repeat step number 1 to 3. NOTE: Flag is the “Two Option” field for two option set fields use true or false in condition. @equals(triggerBody()?[‘cf_flag’],true) Trigger Flow when Lead is created, Lead Source Type is “Trade Show” AND Flag is “Yes”. Repeat step number 1 to 3. AND Condition @and(equals(triggerBody()?[‘cf_flag’],true), equals(triggerBody()?[‘leadsourcecode’],7)) Trigger Flow when Lead is created, Lead Source Type is “Trade Show” OR Flag is “Yes”. Repeat step number 1 to 3. OR Condition @or(equals(triggerBody()?[‘cf_flag’],true), equals(triggerBody()?[‘leadsourcecode’],7))
Share Story :
How to Capture Error Description and Error Log Date in Script Component in SSIS
Our Scenario: To resolve the Errors that occur due to componentMetadata130 and to capture the Error Log Date and Error Description while doing custom Error Handling in SSIS use the following steps. Solution: Error Handling at OLEDB Source Block: Step 1: Add a Script Component to catch the Error Description, Error Log Date and Entity. Select Transformation and click on Ok. Step 2: Connect the Error Output (Red Arrow) from OLDEB Source to the Script Component. Select “Redirect row” for all columns in the Error and Truncation Columns to redirect Error Output to Script Component. Step 3: Configure the Script Component as following: In Input Columns section Select Error Code and Error Column. In Inputs and Outputs section Add following Columns Column Name Data Type Length ErrorDescription Unicode string [DT_WSTR] 500 ErrorLogDate database timestamp [DT_DBTIMESTAMP] —- Entity string [DT_STR] 50 In the Connection Managers Section add a new connection and select your SQL connection. In the Script Section click on Edit Script. After a minute a New Editor Window will Open. Here you have to copy and paste the following Script inside the “public override void Input0_ProcessInputRow(Input0Buffer Row)” section. Code Snippet: try { Row.Entity = “Unit”; Row.ErrorDescription = this.ComponentMetaData.GetErrorDescription(Row.ErrorCode); Row.ErrorLogDate = DateTime.Now; } catch (Exception ex) { Row.ErrorDescription = “Unable to get Error Column Name”; } Click on Save and then Close the Window. Step 4: Add a Data Conversion Block to avoid any Truncation Errors because of Data Type Conversion between NVarchar and Varchar Data Types of the Error Description Column. Select ErrorDecription Column and select Data Type as String. Click on OK. Step 5: Connect the Output columns of Script Component to the required Destination Columns. Conclusion: This is the simplest way in which we can record the Error Description and Error Log Date while custom Error Handling in SSIS.
Share Story :
Filter Gallery based on lookup field (Combo Box) on EditForm
Introduction: In this blog, we will learn how to filter Gallery based on Combo Box which is on different form. Use Case: We have a requirement where there is a lookup field (Price List) on the Editform (Data Source: Quote Project Price List). When there is data in the lookup field the Gallery (Data Source: Role Price) should be filtered. Steps: 1. We have an Screen which is divided into two parts:(Edit Form + Gallery) a. Quote Project Price List Edit Form. b. Gallery with Role Price data source. 2. Add field into the Editable Grid (Gallery). 3. The Lookup Field on the EditForm is PRICE LIST on which the gallery is suppose to be filtered. 4. To filter the Gallery set the Items property of the Gallery to the following formula, Item property: Set Gallery.Item = Filter(‘Gallery Data Source’, ‘GalleryFieldName’.Name = ‘Form Lookup Field Name(Combo Box)’.Selected.Name) For eg: GalleryRolePrice.Item=Filter(‘Role Prices’, ‘Price List’.Name=PriceListLookup.Selected.Name) 5. Output of the screen, The Gallery is not visible as the Lookup Field (Price List) is not selected. 6. After selecting the Lookup Field (Price List), the gallery is visible and also filtered on the basis of the selected field. 7. In this way the Gallery will get Filtered on the basis of the Lookup field on the EditForm.
Share Story :
Add lookup fields in an editable grid using PowerApps
Introduction: We had a requirement where we wanted to show the editable grid in power apps. The fields which are suppose to show are of string, decimal and lookup. Other data type was easy to display but we find difficulties in showing the lookup value. In this blog, we will learn how to add lookup fields(combo box) into the editable grid and also save it in Dynamics 365 CRM. Steps: 1. Insert Gallery : Insert a new gallery – Insert > Gallery > Blank Vertical Add Data Source to the Gallery Go to Properties > Click Data Source you want. 2. Add Combo Box input control in the PowerApps Grid. I have added 3 Combo Box input control inside the Grid, 2 text box, 1 is currency field in the data source and a Save icon. 3. For each Combo Box input box: Item Property: Set ComboBox.Item = Choices([@’Data Source’].<Field Name>) For eg: RoleComboBoxRP_1.Item = Choices([@’Role Prices’].Role) DefaultSelectedItems property: Set ComboBox.DefaultSelectedItems = ThisItem.<Field Name> For eg: RoleComboBoxRP_1.DefaultSelectedItems = ThisItem.Role 4. For each text input box: Default property: Set TextInput.Default = ThisItem.<Field Name> For eg: DescriptionRP_1.Default = ThisItem.Description Note: Do not forget to set the <DefaultSelectedItems> properties or else the value wont be visible in the grid. 5. To Save the changed value into the Data source, set the Save Icon to the following: OnChange property: Set SaveIcon.OnChange = Patch(DataSource, ThisItem, { <fieldName>: TextInput.Text, <fieldName>:ComboBoxName.Selected, <fieldName>:Value(CurrencyTextInput.Text) }) For eg: SaveRP_1.OnChange = Patch([@’Role Prices’], ThisItem, { Role : RoleComboBoxRP_1.Selected, ‘Resourcing Unit’:ResourcingUnitComboBoxRP_1.Selected, Unit:UnitComboBoxRP_1.Selected, Description:DescriptionRP_1.Text, Price:Value(PriceRP_1.Text) }) 6. The Output Screen. 7. The changed Lookup value. If you click the Save Icon the changed values will be saved. In this way we can change the Lookup values and also Save the changed value in the Dynamics 365 CRM.
Share Story :
Post Entity and its Relationship with Lead Entity
Problem Statement: We have a recent requirement, where we had to make an SSRS report that will display the latest post against a Lead. Post as an Entity is not visible in customization, also in advance find of Lead, we do not have any related attributes from post. This makes it difficult to generate the query. Solution: When we check the relationship between lead and POST, we find the below The entity named Post regarding is not present in customization and neither is visible in Advanced Find. If we check the advanced find for posts, we will not find any field that is providing related details of lead. But if we go to edit columns and check the available columns, we will get a column named regarding. We can use the below XML Query to generate our SSRS Report. Conclusion: Some entities like POST,POST regarding and their attributes are hidden in CRM. Metadata Document Generator in XRM Toolbox can be used to view these hidden entities and fields. You can refer my blog Find hidden entities in CRM using metadata document generator from XRM Toolbox to know how to use Metadata Document Generator in XRM Toolbox.
Share Story :
How to use Expand Query in MS Flows
Introduction This blog explains how to use Expand Query (N:1 Relationship) in the Common Data Service List Records Connector. Steps to be followed: Initialize Variable of type string. Using Expand in list RecordsExpand Query: cf_Project($select=cf_projectname,cf_projectabbreviation) Here cf_Project is the Schema Name of Project Lookup field on location entity. Pass the field names of the project entity that you want. Here I have passed cf_projectname and cf_projectabbreviation. Result of list record: You can see we get Project value in the below format to use this we have to parse the JSON. “cf_Project”: “{\r\n \”cf_projectname\”: \”Client Commercial\”,\r\n \”cf_projectabbreviation\”: \”CC\”,\r\n \”cf_pmtrackerid\”: \”3b576605-9c82-e911-a839-000d3a07f695\”\r\n}” Retrieving Project Values. Use “Apply to each” to get the value of the Project. Pass “Value” of “List Records” from Dynamic Content in “Select an output from previous steps” Now Set the Value in the “Project” variable which we had initialized earlier. Go To Expression and type: items(‘Apply_to_each’)[‘cf_Project’] Note: Here “cf_Project” is what we had retrieved in the output of ‘list records’. Make sure you pass this value correctly. “cf_Project“: “{\r\n \”cf_projectname\”: \”Client Commercial\”,\r\n \”cf_projectabbreviation\”: \”CC\”,\r\n \”cf_pmtrackerid\”: \”3b576605-9c82-e911-a839-000d3a07f695\”\r\n}” Result of Project Variable: Parsing JSON. Use “Parse JSON” action Add “Project Variable” in Content from “Dynamic Content” Click on “Generate from sample” to generate JSON Schema Enter sample JSON payload and click on done. { “cf_projectname”: “Test Project”, “cf_projectabbreviation”: “TR”, “cf_pmtrackerid”: “3b576605-9c82-e911-a839-000d3a07f695” } It will generate a JSON Schema automatically. Using Project Values. After parsing Json successfully you can use the values of the project entity field. You can use “Compose” to get and check the value. Enter “cf_projectname” in “Compose” inputs. OutputEntire FLOW: NOTE: You can add multiple expand queries in List Record:Query: cf_Project($select=cf_projectname,cf_projectabbreviation),cf_ParentLocationId($select=cf_name)
Share Story :
Calculated Field in Dynamic 365 CE
Introduction In this blog we will see how to use Calculated field. Use Case : Its common requirement of Project to set calculated date to specific date field by adding or Subtracting the no. of days. Implementation : Step 1: Let say we have date field in an Account Entity. Step 2: Create one more date field with data type as date with field type as calculated field. Select field type -> Calculated -> Edit Step 3: Click on Edit. and add condition. In this scenario , I want to add 3 days to the selected date which is date created field. So the condition is if current entity date created field contains data And then add action. Save and close Result :