Dynamics CRM Archives - Page 6 of 15 - - Page 6

Category Archives: Dynamics CRM

Making Managed fields required dynamically in Dynamics 365

On some instances, there are Managed fields in Dynamics 365 CRM (or CE if you want to call it) where we can’t change the required level of the field from Fields i.e. on the database level. And you get the below error – Here’s an alternative way to do it. Scenario Let’s consider this scenario. Although Microsoft suggests you don’t change the behavior of Managed fields since they are designed with a purpose. However, let’s consider this scenario where you want to make the Parent Account for Lead as required on the form.When you try to change the Requirement Level as follows And while saving this change, you get this error. So how do we do it? Let’s see. Workaround – Business Rule Now, to overcome this particular scenario you can implement a simple Business Rule to make it required as follows – If the field can’t be made Required on a database level, you can make it required on the form using Business Rule. Here’s how you create your Business Rule.As the Business Rule starts with the condition, here’s the check you need to add in case the field value is not entered. The condition I used is as below – Check if Parent Account for lead Does Not Contain Data If this is True, then go ahead and add a Step for True condition. Add Set Business Requirement Level And in this, you need to set the Business Required Status to Business Required as show below. And the result is the Business Rule which looks like in #1 above. Now, save your changes, Publish the Rule, Activate and check. The result will be that the field is not required once it doesn’t have data forcing the user to enter data for the same. Hope this is helpful!

Share Story :

Quick Tip – Enable/Show Activities on Notes in D365 CRM

In this blog, we will see how we can show activities on Notes in D365 CRM.  Step 1 – Click on Entity and check marked Activities. Save and publish the Entity. Step 2 – Open Main form where you have added timeline, Double click on timeline notes and mark filter by as Show all. Save and Publish the form. Output before enabling the activities Output after enabling the activities

Share Story :

Integrate LeadFeeder with Dynamics 365 CRM

Introduction:  Leadfeeder provides details of companies visiting your website, you can integrate the same to D365 CRM. STEP 1: Login to LeadFeeder; On the right corner click on your Account and then on Settings. You will see the below screen, click on Account to see all possible integrations. Click on Dynamics 365 STEP 2: Follow the integrations given on the page, click on the solution to download and then import to your CRM Environment. After publishing, add your CRM URL on point 2 and click authorize on point 3. The Sync process will start and you will be able to see below screen.  You can make changes to settings are per your requirements. The auto sync works once per day, you can choose to Sync now. In case of issues, you can Reconnect or Remove the Integration as well.

Share Story :

Reopen Closed Appointment Using JavaScript in D365 CRM

Introduction: When an appointment is closed in D365 CRM, the appointment is not editable. There can be a requirment when Users wish to edit the closed appointment and add some missing data. This can be achieved by adding a new button on the Appointment form. Solution: Add a new button and use below JavaScript. var AppointmentForm = { setActive:function(primaryControl) { var formContext= primaryControl; var status= formContext.getAttribute(“statecode”).getValue(); if (status==1) { formContext.getAttribute(“statecode”).setValue(0); formContext.getAttribute(“statuscode”).setValue(1); formContext.data.save(); } } } To understand the status and status reason details, you can refer the Microsoft document- https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/appointment?view=dynamics-ce-odata-9 Note that, you need to update both statecode and statuscode, trying to update only one will give a system error. Conclusion: You can Activate and edit the appointment, once done user can click on Mark Complete, to close the appointment.

Share Story :

C# Code to retrieve lookup value id from target entity in D365 CE.

Let us consider below example as use case We have Plugin that triggers on Update of Contact Table and wanted to retrieve Customer related to Contacts. Customer is Lookup field on Contact Table. Hence here our target entity is Contact. Code – Entity targetEntity = (Entity)context.InputParameters[“Target”];   Guid ContactId = targetEntity.Id; Using the above code we get the target entity Contact Guid and now we need to retrieve Customer lookup from the target Entity. var cols = new ColumnSet(new String[] { “parentcustomerid” }); Since we only want Customer lookup from Contact hence retrieving only Customer and you can retrieve columns as per your requirement. Entity parententity = service.Retrieve(“contact”, targetEntity.Id, cols); We have stored Retrieved values in parententity. Guid ParentAccount = ((EntityReference)parententity.Attributes[“parentcustomerid”]).Id; And in above step we get the Guid of Customer. Conclusion – This was simple example of accounts and Contacts, you can use the above code(specify the schema name of lookup field you want to retrieve) to retrieve any lookups from your target entity based on your requirement Hope this helps !

Share Story :

[Resolved]You don’t have permission to view files in this location, Contact your Microsoft team owner or SharePoint administrator for access.

We added a new User in CRM, User has the System Administrator role but still were getting the below error. You do not have permission to view files in this location, Contact your Microsoft team owner or SharePoint administrator for access.  We did check User’s SharePoint access and, but it did not work. Solution – In User entity [OOB], there is OOB field called as “Sharepointemailaddress”.  Add same email id of User -> save the record and it will be resolved. Hope this helps!

Share Story :

Capture Case Resolution data before reopening case using C#

Introduction: When we reactivate cases, the old case resolution record is set as cancelled and a new case resolution record is created, before you re open the case, you can actually store case resolution data, which you can later use when you re-close the case. Solution: Below is the code to get case resolution data   Code below is to close case again with data saved as per above string Note: Case Resolution entity is not visible through advance find, for testing purpose, you can filter activities by activity type= case resolution and regarding as your case Id.

Share Story :

Disable field on change of tab in D365 CE

Use case – Our requirement is to enable field description field on invoice line form on clicking of tab General. Let’s see how we can achieve this Solution – Step 1 – Create web resource with below function- var invoiceLineCustomization = {     unlockField : function(executionContext)     {         var formContext = executionContext.getFormContext();             formContext.getControl(“description”).setDisabled(false);     }, } Step 2: Add this web resource on tab property event TabStateChange and try. (path to go to event tab – Click on tab -> change properties -> event) Output – Hope this helps !

Share Story :

Get Time in Hours and Minutes from a Date Field in CRM using JavaScript.

D365 gives a functionality to create a Date and Time field where in you can provide the user to select the date or both date and time. But what if you just need the time in Hour and Minutes format from the selected date in the Date field, This can be achieved using a JavaScript. In this blog lets see how we can get the time entered in the date and time field and format it in hours and minutes format. I have created a field in CRM with field type Date and time. Here is how it looks Using the JavaScript “Date” functions you can get the Time entered in the date and time field as shown below. This code gets the date and time (hours and minutes) selected in the date field and will format the hour and minutes in the format “HH:MM“. Hour – (getHour()) Minutes – (getMinutes()) Output – Note : You can also add the AM / PM to the time string I have not added it in my time string “strTime” but have stored the value of it in “ampm“. Hope this helps !

Share Story :

Get Month | Day | Year from a Date field in CRM using JavaScript.

D365 gives a functionality to create a Date and Time field where in you can provide the user to select the date or both date and time. But what if you need just the month from the selected date in the date field or say the date or year from the selected date in the date field, This can be achieved using a JavaScript. In this blog lets see how we can split or get the Month | Day | Year from a selected date in the CRM Date and time type field. I have created a field in CRM with field type Date and time. Here is how it looks Using the JavaScript “Date” functions you can get the Month | Day | Year and Time of the entered date as shown in the below script. This code gets the date selected in the date field and splits the date into Month – (getMonth()) Note : January – December is (0-11) hence add 1 so make it (1-12). Day – (getDate()) Year – (getFullYear()) This code gives the month date and date in 2 digit format i.e. if the date is a single digit say 9 it will give it as 09. You can further use this according to your requirement either to change the date format or for many other date related customizations. Hope this helps !

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange