Dynamics 365 Archives - Page 52 of 88 - - Page 52

Category Archives: Dynamics 365

Send Custom Emails using SendGrids API

Introduction: In this blog we will demonstrate how to send custom emails using SendGrids API. Scenario: If we want to send custom emails to customers stored in Dynamics 365 with different email body for every customer based on their data stored in CRM, it is not possible to do so by using the normal Email Editor as it has some limitations while displaying dynamic content. One way of doing this is by creating a console app which will use SendGrids API to send out custom emails for every customer. Pre-Requisites: Visual Studio SendGrid Account Implementation: Step 1: For this demonstration we will see how to send out a mail to a single email. First we create a Console App in Visual Studio Step 2: Once the Project is created Right Click on the Project and select Manage Nuget Packages Browse to the latest Nuget packages and install SendGrid package Step 3: Next we have to create an API Key in SendGrid. Just give a name for a key and Click on Create Key which will generate a unique key. Store this key which will be used in the Code Step 4: Below is the Code to send email: using SendGrid; using SendGrid.Helpers.Mail; using System.Threading.Tasks; namespace SendGridConsoleApp { class Program { static void Main(string[] args) { string sendGridAPIKey = “EnterKeyHere”; Execute(sendGridAPIKey).Wait(); } static async Task Execute(string _apiKey) { var client = new SendGridClient(_apiKey); var from = new EmailAddress(“test@gmail.com”, “From UserName”); var subject = “MAIL Send Through SendGrid”; var to = new EmailAddress(“test@gmail.com”, “To UserName”); var plainTextContent = “Example PlainText”; var htmlContent = @”<!DOCTYPE html><html><head><style> table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: 8px; } tr:nth-child(even){background-color: #f2f2f2 } th { background-color: #4CAF50; color: white; } </style></head><body><h2>Important Details</h2> <table><tr> <th>Firstname</th> <th>Lastname</th> <th>Email Address</th></tr> <tr><td>Peter</td><td>Griffin</td><td>pgriffin@gmail.com</td></tr> <tr><td>Lois</td><td>Griffin</td><td>Lois@gmail.com</td></tr><tr> <td>Joe</td><td>Swanson</td><td>joe@gmail.com</td> </tr><tr><td>Cleveland</td><td>Brown</td> <td>clev@gmail.com</td></tr></table></body></html>”; var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent); var response = await client.SendEmailAsync(msg); }}} Step 5: Once the Console App is run the email is send below shown is the sample of the Email sent While running this for multiple customers we can create different HTML body content for each customer and pass it to the CreateSingleEmail function.This approach can also be used to send bulk emails to customers.

Share Story :

Keep access to Assigned records in D365

Introduction: At times, you are asked to assign certain CRM records to other users and you just have to do it as a part of the process. But let’s face it, you still wonder what might have happened to the record after you assigned it to them but your security roles won’t let you access those. There’s a general D365 setting for this too! You can share your D365 records with other but still retain rights to yourself so keep track of what happened with those later on Setting: Navigate to Settings > Administration > System Settings In General tab, look for the Setting where it reads as ‘Set whether reassigned records are shared with the original owner’ (quite self-explanatory) Assign Record and check Share Rights: Now, assigning a records from Priyesh to John as shown below – Priyesh would still have rights to the record. Check the Share status of the same. The record will be owner by John but will be shared with Priyesh too.

Share Story :

Using MS Flow and D365 App For Outlook To Track Proposals and Win Opportunities Without Leaving Outlook

For every sales person, getting a signed contract from the client is a euphoric moment. You finally closed the deal, and everything seems right. But the process after winning the deal is cumbersome for many of us. This article documents how we made this process a lot less painful through MS Flow and the D365 App for Outlook. Hopefully you find it very useful as well. I will first walk you through my old process – Once I got the signed contract as a Word or PDF attachment in my email, I would download it and save it to my OneDrive under the respective client folder. I would then open D365, go to the opportunity, then browse to the Documents folder and create a new SharePoint document folder. Then I would click the upload button and browse to the document location the OneDrive folder on my computer and attach the proposal. I would then finally mark the opportunity as Won, which would send out internal emails to our Delivery Team (for Project creation), Accounts Team (for billing details) and our HR team (so they can keep an eye on recruitment needs). Here is what we achieved through the implementation of the new process using MS Flow and D365 App for Outlook – Once I got the signed contract in my email, I would track this email using the D365 App in Outlook. I would also set the regarding field as the Opportunity that this proposal is for. The above action would trigger an MS Flow that would do the following in near real time – It would check if the Opportunity already had a folder created and if not, it would first create the SharePoint document folder on the Opportunity. It would then upload the proposal to the above folder. It would remove the attachment from the tracked email (saving valuable space!) I would then open the Opportunity right from my D365 App for Outlook and mark it as Won. The step by step directions for setting up the MS Flow are documented in this blog article from Krishna Bhanushali from our D365 team – https://www.cloudfronts.com/move-attachments-from-tracked-email-to-sharepoint-using-microsoft-flow/. In conclusion, the above implementation has benefited us through – Significantly reduced number of steps post winning a deal. Time saved by not having to leave Outlook which is where most of us are spending our time. A better process that makes pipeline management easier for sales people, thus driving adoption. If you want to discuss your sales processes further or provide any feedback for improvement, I can be reached at ashah@cloudfronts.com.

Share Story :

How to set a default chart in a view’s Chart Pane

Introduction: This blog explains how to set a default chart in a view’s Chart Pane Scenario: We have created custom chart on order named as Order by printing status. We want this chart should get open when user click on charts pane Steps: Go to Customization –> Order –> Charts. Click on More Actions –> Export Chart. .xml file will get download. Open that file with notepad. Search isdefault and set its value to true. Save Click on More Actions –> Import Chart Import the customized chart. Replace and Import Chart. Publish Customization. Now you can see that chart as default chart.

Share Story :

Error handing in MS Flows

Introduction: In this blog we will be going through the steps of Error Handling in Microsoft Flows. Implementation: Step 1: We have created a basic flow that is triggered when a HTTP POST Request has be made to the generated URL. The body will contain a JSON array with some data The flow will then take the data passed in the POST request body and for each object in the JSON array, it create a record in Dynamics 365 Customer Engagement as shown below. In the above scenario  we pass the correct data, but in case the data that is passed to the URL is not correctly formatted or the data is missing we will encounter an error and the flow will fail. To handle such situations we will define an action that will take place when an error is encountered. Step 2: To Log the error, we will create another action to create a log error log in Dynamics 365 Customer Engagement.  To make sure that this is created only when an error is encountered we click on the Configure Run After option as  shown There are four options shown, here we select only the “has failed” option which states that the log will be created when there is a failure. Once this is done we can see the the flow shows a dotted red line for the last step, this is because the “Log Error in CRM” action will run only in one scenario i.e. when the above action has failed. The benefits of using this approach in our flows is that we can log all the errors at one place and also store the error response of the previous stage by simply selecting the Dynamic Content in the “Log Error in CRM” action.

Share Story :

Update field value based on the current stage of Business Process Flow and trigger workflow when Business Process Flow is finished.

Posted On October 25, 2018 by Admin Posted in

Introduction: This blog explains How to Update field value based on the current stage of Business Process Flow. How to Trigger workflow when Business Process Flow is finished. PART A: Scenario: We have a custom Business Process Flow with 4 stages on Order entity. Whenever user changes the stage of Business Process Flow status field is updated. (we have created custom status field named as printing status). Steps to be followed: 1. Create Real time Workflow on Business Process Flow Entity. 2. Trigger workflow on Process Changes: 3. Add Step –> Update Record. Update the field value with active BPF stage. 4. Create another real time workflow on Order entity. 5. Trigger on Record Field Change and select the field where you are updating the stage value. 6. Add Step –> Check Condition and Update the field value.  (check the stage field value and update the status accordingly ) For example first stage in BPF is waiting for jersey then we will check if Current stage is equal to waiting for jersey then update the printing status to waiting for jersey. Complete Workflow: PART B: How to Trigger workflow when Business Process Flow is finished. Scenario: Update the Order Status to fulfilled  when Business Process Flow is finished. Steps to be followed: 1. Create a Real time and on demand workflow on Order entity. 2. Add Step -> Change Status to complete 3. Activate the workflow. 4. Go to Business Process flow which you are using and perform the below steps: a. Drag and Drop the workflow in Global Workflow. b. Trigger the workflow on when process is completed and select the workflow which you have created. (you will only see on demand workflows)

Share Story :

Posting Restriction for Journals- Dynamics 365 Finance & Operations

Posting restriction feature allow to determine whether specific user or user groups can post only journals that they create. You can use Journal names for posting restriction setup. Navigate to  General ledger > Journal Setup  > Journal names. Select Journal names for which you want to apply Posting restriction. Click on Posting restrictions button To set up posting restrictions by user group, select By user group.Select the check box next to the user group name. To set up posting restrictions by user, select By user. Select the check box next to the user name. Click OK to apply the restrictions and close the form.

Share Story :

PSA – Create Time Entry Delegations for all resources

Background: One of the frequent requests we continuously get from our clients is for someone else to do Time entries on behalf of other resources. We know that this can be done using Delegations feature in Dynamics 365 PSA. You can read more about delegations here written by another D365 PSA Expert – Priyesh Wagh : Delegating Time Entries in D365 PSA Example: But if we want to do this for all the Resources, then it is tedious and not practical to ask each resource to create delegate. For example, on of our clients requested that HR should be able to enter Time entry on behalf of any resource in the organization. I also saw that many organizations need a feature like this. So I thought of creating a console application which will get all the Bookable resources of type User and create Delegations. Below is the code that you can use to create delegations for all users in the organization. You can use the same code to create a plugin if you want to automatically create delegate on creation of Bookable resource. Sample Code: You can get the entire code from my Github #region Create Delegations for all User Bookable Resources to Particular person foreach (Entity bookableResource in userBookableResources.Entities) { Entity TimeEntryDelegation = new Entity(“msdyn_delegation”); TimeEntryDelegation[“msdyn_delegationfrom”] = new EntityReference(“bookableresource”, bookableResource.Id); TimeEntryDelegation[“msdyn_delegationto”] = new EntityReference(“bookableresource”, DelegateToId); TimeEntryDelegation[“msdyn_startdate”] = new DateTime(2018, 10, 1); TimeEntryDelegation[“msdyn_enddate”] = new DateTime(2022, 12, 31); TimeEntryDelegation[“msdyn_type”] = new OptionSetValue(192350000); //Time Entry TimeEntryDelegation[“msdyn_name”] = string.Format(“Delegation to HR for {0}”, bookableResource.GetAttributeValue<string>(“name”)); try { Guid DelegationId = _client.Create(TimeEntryDelegation); } catch (FaultException<OrganizationServiceFault> ex) { Console.WriteLine(“Resource: ” + bookableResource.GetAttributeValue<string>(“name”) + ” Error: ” + ex.Message); } } #endregion Note: Please note that the “Delegate to” Resource/ User should also have Delegate role in order to be able to do time entry on behalf of others. If not, then you will face below error:

Share Story :

Contract Invoice Schedule Status Change on Invoice Actions

Stages of Invoice Schedules are changed behind the scenes as you perform actions on the Invoice of the Contract. Let’s see what we have got here – So, when an Invoice Schedule is Ready for Invoicing, it will be considered in the Invoice you’ll end up creating. Now, if you create the Invoice for that Contract (shown below) The status now changes to Customer invoice created. And, when you mark that Invoice as Confirm, shown below – The Invoice schedule record’s Invoice Status will be changed to ‘Customer invoice posted’ Pretty straight forward!

Share Story :

Move Attachments from Tracked Email to SharePoint using Microsoft Flow

Introduction: Microsoft flows can be used to automate many workflows across multiple applications and services. This is basically designed for non-developers. To create a flow, the user specifies what action should take place when a specific event occurs. In this blog, we will have a look on how we can add the attachments from the emails that are tracked in Dynamics 365 CRM to SharePoint Systems included in Document Integration D365 App for Outlook SharePoint Dynamics CRM Online V9 Note: We have taken Opportunity tracked Emails for this example, you can work on any entity. Let’s start with the steps that should be undertaken to achieve the above requirement. Step 1: Create a blank Flow template. Choose the Dynamics 365 Connector and trigger as, “When a record is created”. Select your Organization Name, and the entity, in our case it is Email Messages. Step 2: Add condition to check whether the email is related to Opportunity and whether it has Status Reason as Received. By default, the condition you can specify is basic. Change in to Advance mode and add the below formula Formula used: @and ( equals(triggerBody()?[‘_regardingobjectid_type’], ‘opportunities’), equals(triggerBody()?[‘_statuscode_label’], ‘Received’) ) Step 3: For the true part of the condition, retrieve the Opportunity record to which the Email is tracked. The reason behind retrieving Opportunity Name is to create SharePoint Folders. Folders will be created on the format Topic_OPPORTUNITYGUID.   Step 4: Now let us retrieve all the Activity Mime Attachments associated with the Email Message that is created. There are two Attachments entities available for the selection. The first one is the Attachment entity The second one is the Activity Mime Attachment entity. Step 5: Retrieve Attachment related to the Activity Mime Attachment for the Body and File Name of the attachments. Now steps to check the presence of Document Location starts Step 6: Retrieve the Document Locations for the current opportunity record to see if there is an already defined path or not. Select “List Records” action and enter below fields Step 7: After retrieving the Document Location records, verify the length of the records in the collection. Formula used : length(body(‘Retrieve_Document_Locations’)?[‘value’]) Step 8: For the true part of the condition, follow the below steps: Step 8.1: Select connector as SharePoint and select Create file Action. Enter all the details listed below: 1) Site Address: The SharePoint Site Address 2) Folder Path: The path where the file need to be stored. i.e. /opportunity/Topic_ toUpper(replace(body(‘Get_record’)?[‘opportunityid’],’-‘,”)) For Example the folder Name will be : Topic_E608E808F4A1E811A977000D3A37051A 3) File Name: Name of the file 4) File Content: The attachment body Step 8.2: Delete the Attachment record from the Dynamics CRM Email message. Here you need to select the first option of Attachments from the list. Step 9: For the false part of the condition below are the steps you should follow: Step 9.1: Create a file in SharePoint. Refer Step 8.1 Step 9.2: Retrieve the Parent Document Location. This is needed as we are creating the document location by ourselves. Step 9.3: Create the Document Location record for the record that was just processed. Parent Site or Location: This is the GUID of the parent Doucument Location retrieved in Step 9.2 Relative URL formula: replace(replace(body(‘Create_file_3’)?[‘Path’],’/opportunity/’,”),concat(‘/’,body(‘Create_file_3’)?[‘Name’]),”) Step 10: Delete the Attachment record from the Dynamics CRM Email message. Here you need to select the first option of Attachments from the list. Now you can test by sending email and tracking to Opportunity in D365 App for Outlook in Dynamics CRM. Document will be uploaded to SharePoint with specified location.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange