D365 General Archives - Page 9 of 30 - - Page 9

Category Archives: D365 General

Set Field Visiblity based on Security Roles in Dynamics 365

Introduction: In this blog we will demonstrate how to set visibility of a field in Dynamics CRM based on Security Roles using JavaScript. Implementation: Step 1: First we create a security role, Here for our demonstration I have created a Blank Security Role with the name “CustomEditAccess”. Copy the GUID of the security Role as this will be used later in the Code. Step 2: If the user does not have the custom security role that we have created we will hide the Parent Account field else we will show the Parent Account field. For this first we go to the Form Editor and set the Visible by Default to “No” for the field “Parent Account” Step 3: Create a new JavaScript Web resource  and add the following code: var accountFormCustomization = { customEditAccess: function (execContext) { debugger; var formContext = execContext.getFormContext(); var userSettings = Xrm.Utility.getGlobalContext().userSettings; //Get Security Roles of the current User var securityRoles = userSettings.securityRoles; //Below is the GUID of the Security Role “CustomEditAccess” var securityRoleId = “B9E23C5A-F5F9-E811-A96C-000D3AF29D99”; for (i = 0; i < securityRoles.length; i++) { //If current User contains the Required Security Role if (securityRoles[i].toUpperCase() == securityRoleId.toUpperCase()) { //Field should be Set to Visible formContext.getControl(“parentaccountid”).setVisible(true); }}}} Note: Here we have set the visibility of the Parent Account(parentaccountid) field to “True” to show the field on the form. Step 4: Once this is done we register an Event On Form Load, as shown below: Remember to pass the Execution context as the first parameter Step 5: Once this is done when the form is loaded, the script will check if the User has the required Security Role, if yes then the “Parent Account” field will be shown else it will be hidden by default. Tip: Here we have hardcoded the GUID of the security role, what we could also do if fetch the GUID of the security role based on the Name of the Security role and then follow with the Hide/Show visibility logic. Conclusion: This is another alternative to field level security and this can be implemented if you find Field level security too complex as your requirements in the organization grow.

Share Story :

Dynamics 365 Online Authentication with Client Credentials

Introduction: This blog explains how to Authenticate Dynamics 365 Online with Client Credentials. Steps: Steps in Azure 1. Register a App in Azure Active Directory. Login to portal.azure.com Navigate to Azure Active Directory –> App Registration –> New Application registration 2.  Create App with Application type -> Web app/ API. Copy the Value of Application ID. 3. Give permission to Dynamics 365 Online. Go to Settings –> Required permissions –> Add –> Dynamics CRM Online –> Select  Select the following permission. 4. Click on Grant Permissions –> Yes 5. Generating client secret key. Go to Settings –> Keys Create a new key and copy its value Steps in D365 Sales Create Application user. 1. Add a user from Portal.office.com 2. Go to settings -> security -> users. Change the view to Application Users. Add New user. 3. Enter User name and Application ID. Value of Application ID is obtained from MS Azure. 4. save 5. After Saving values of Application ID and Azure AD Object ID will come automatically. Steps in Azure 1. Add this user as Owner of the App which we created in MS Azure. Settings –> Owners –> Add owner 2. Obtain tenant id Azure Active Directory –> Properties –> Directory ID   Making a Request using Postman POST URL: https://login.microsoftonline.com/<tenant id> /oauth2/token Header:Content-Type: application/json Body: Key Value client_id Application ID of the registered app in Azure resource https://trial.crm.dynamics.com (Dynamics 365 Online Insance URL Client_secret Key value from the registered app in Azure Grant_type client_credentials Below screen shows how to use above given keys to generate the access token. This token has expiration time. You need to refresh this token.

Share Story :

Track Emails by setting “Tracked To Dynamics 365” Category in Outlook

Introduction: Ever thought of how tracking in Dynamics 365 App for Outlook could be easier? Guess What? Using “Category Based Tracking” you can now easily track Mails, Appointments and Tasks by simply setting a category on them in Outlook. This feature is beneficial as you can select multiple emails, set the category, and the rest is all done for you. We can also provide the same permissions to a delegate and forget about tracking emails, which will be done by them on our behalf. In this article we will go through how to enable Category based Tracking in Outlook and assigning a delegate to do it for us. Pre – Requisites: Outlook D365 Customer Engagement Dynamics 365 App for Outlook Implementation: Step 1: First we must enable tracking using Categories in Dynamics 365. To do this we must import the “Organization Settings Editor” latest managed solution .zip file present at “https://github.com/seanmcne/OrgDbOrgSettings/releases” in our instance. Once done, open the solution and find “TrackCategorizedItems”. As shown below the default value set is “false” and the current value is not set. Click on Add > then an Edit button is shown where we change the value from “false” to “true” as shown, after which everyone in the organization will be able to see the category in their outlook. Step 2: On Opening Outlook after few minutes, in the categories we can see the “Tracked in Dynamics 365”. Step 3: Now if you want to track any particular mail to Dynamics 365, you can set the category of the mail to “Tracked To Dynamics 365”. When the server-side synchronization takes place, an activity record in created in CRM. In a similar way, we can Right Click on Appointments and Tasks in Outlook to track then in CRM. Step 4: To view  tracking progress you can configure the Dynamics 365 App for Outlook which shows the status as Tracking Pending/ Not Tracked/Tracked. Step 5: In addition to this, we can also configure Delegate access so that you provide permission to another person who will performs these tasks on your behalf and track emails. Right click on the Inbox folder in Outlook > Permissions Click on “New” and add the person whom you want to provide the access and click Add. Modify Permission as Required. Note: If you want the delegate to set the “Tracked To Dynamics 365” category you will have to provide “Edit All” permission. Step 6:  Once this is done, the user with whom the mailbox is shared must add the mailbox in their outlook: Right Click on Root Folder > Add Shared Folder > Add email of the user who has shared their mailbox. After which the Shared Mailbox will be visible. To enable the delegate to set categories of the shared folder you must click on “Share” on the top ribbon in you calendar and provide “Delegate Only” Access to the Delegate. The delegate will receive an email to accept and add the calendar, after which he/she will be able to set the categories on the shared folder mails. Note: After the owner of the folder shares the calendar make sure that the permissions that were previously assigned to the delegate are still intact else the categories sections will be disabled for the delegate. Step 7:  To share the details of other folders under the root folder in Outlook, the process is the same, but you will to provide “Full Read Access” permission to the root folder and the desired custom permissions for the required folder. Conclusion: By setting this tracking category to mails on Outlook you can minimize the number of clicks and easily track activities in Dynamics CRM.

Share Story :

Assign your D365 records but keep access as well

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 System Settings: 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. Hope this is helpful!

Share Story :

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.in/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 :

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 :

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 :

New D365 Admin portal and new way to access Organization Insights

Introduction: Lot of D365 Administrators would have observed that we no longer see the Organization Insights solution on AppSource anymore. This is because you can now see the Organization Insights on the new Administration portal for D365. New D365 Admin Portal! There is new portal for D365 Administration which is in preview. You will see the option to go to new D365 Admin Portal from the Current Admin portal screen. Administrators can also access the portal from the URL: https://admin.powerplatform.microsoft.com The new portal is also called as the Power Platform since it now includes Administration of your Power Apps and CDS as well. You can manage the environments, do the analytics and lot more things. I am expecting this Portal will be upgraded and will have lot more features in future.

Share Story :

SEARCH BLOGS:

[gravityform id="36" ajax="true"]

FOLLOW CLOUDFRONTS BLOG :