Powershell Cmdlets for Dynamics CRM On-Premise

To use the cmdlets for Dynamics CRM On-Premise, do the following. Go to the server running the Full Server role for Dynamics CRM. Type in: Add-PSSnapin Microsoft.Crm.PowerShell You can now run CRM commands. Type in: Get-Help *Crm* CRM will return help information on its commands: You can then run individual commands, for example, it you want to see CRM settings, you can run a command to get a particular setting. … Continue reading Powershell Cmdlets for Dynamics CRM On-Premise

Getting and Setting a Dynamics CRM Field in JavaScript

To get and set a Dynamics 365 field, first find out the field name. Open the form and find the field, for example on the leads form, the topic: Double click the field and see what the Name is, in this case “subject”:   function UpdateField() { var s = Xrm.Page.getAttribute(“subject”).getValue(); alert(s); Xrm.Page.getAttribute(“subject”).setValue(“Hello World”); var s = Xrm.Page.getAttribute(“subject”).getValue(); alert(s); } When this runs we see first the original topic: Then … Continue reading Getting and Setting a Dynamics CRM Field in JavaScript

Dynamics 365 Business Rules

Business Rules are a way in Dynamics 365 to add actions to events that occur in the user interface. Let’s go through an example with the Leads form. Select Business Rules from the navigation bar and then New Business Rule: This will open a blank template. Let’s add a condition that if the City = “New York”, then lock the description field. Click Activate: As soon as the City is set, the … Continue reading Dynamics 365 Business Rules

Dynamics 365 Troubleshooting User Access

There are times when users will not have access to resources in Dynamics 365 when they should. Dynamics 365 will throw an error based on the type of denied access. Generally, these access errors can be resolved by determining what the resource is the user is trying to access and then granting the user access to the resource through an security role. For example, if a user wants to assign a security role … Continue reading Dynamics 365 Troubleshooting User Access

Dynamics CRM Read Only Form and Disable Fields with JavaScript

One way to lock down a form is through JavaScript. Let’s go through how to do this by locking down the Leads form. Create a new solution and add the Leads form: Select Form Properties and Add from the Form Library. We will be adding a new JavaScript library: Select New: Enter information below: Click Text Editor and enter the JavaScript: function ReadOnly () { var cs = Xrm.Page.ui.controls.get(); for (var … Continue reading Dynamics CRM Read Only Form and Disable Fields with JavaScript

Dynamics CRM Filtered Views

Dynamics CRM provides filtered views so we can access CRM data in SQL. To access filtered views, go to the Dynamics CRM company database and go to Views. You will see views starting with the name “Filtered”: Selecting from the filtered view returns the results, e.g. Custom entities also have filtered views: The views have standard fields as well as new fields: Option set fields appear in filtered views as two SQL … Continue reading Dynamics CRM Filtered Views

Dynamics CRM Create Option Sets

Option Sets are used in Dynamics CRM to allow a user to select a value from multiple selection options. We will go through an example where we will add a field, Favorite Color, to Accounts. First, create a new solution in Dynamics CRM. Add the accounts entity to the solution. Then, go to fields and select new field. Give the field a display name and set the data type to Option Set: You can … Continue reading Dynamics CRM Create Option Sets

Microsoft’s Power Couple: Power BI and Microsoft Dynamics

Power BI, Microsoft’s cloud based business intelligence service, is a must-have component for companies running any of the products in the Microsoft Dynamics suite, whether it is CRM, AX, GP, NAV or Project Madeira. As a modern intelligence tool, it enables companies to rapidly get insight into their data and interactively find trends to make informed business decisions. Without BI, companies lack visibility and may be running with the wrong roadmap. Businesses already have basic reporting into their data, such as what last month’s sales were, who … Continue reading Microsoft’s Power Couple: Power BI and Microsoft Dynamics

Dynamics CRM Unified Service Desk Setup

Once USD has been installed (see my earlier post) the next step is to configure it. In Dynamics CRM, you can access the USD setup in Settings->Unified Service Desk: Clicking on Hosted Controls, you can see a list of the out of the box hosted controls: Let’s create a new hosted control. The control will show the start page of Dynamics CRM. Click “New” to create a new hosted control. Give … Continue reading Dynamics CRM Unified Service Desk Setup

Dynamics CRM Generic SQL Error

One way a generic SQL error can occur is when dealing with ConditionOperator in QueryExpression. Consider the following code to get all users who’s first name is Bob:  QueryExpression userquery = new QueryExpression(); userquery.EntityName = “systemuser”; ColumnSet cols = new ColumnSet(); cols.AddColumn(“systemuserid”); userquery.ColumnSet = cols; ConditionExpression ce = new ConditionExpression(); ce.AttributeName = “firstname”; ce.Operator = ConditionOperator.Contains; ce.Values.Add(“Bob”); FilterExpression filter1 = new FilterExpression(); filter1.Conditions.Add(ce); userquery.Criteria.AddFilter(filter1); EntityCollection entColRoles = _orgService.RetrieveMultiple(userquery); if (entColRoles != null && … Continue reading Dynamics CRM Generic SQL Error