Load BusinessProcessFlow thru JavaScript in Dynamics 365

There is a known defect loading active Business Process Flow on the Form, when you upgrade from CRM 2016 to Dynamics 365. It does not load for some records which came thru ETL. If you check in Advanced Find including Process Id column, Process Id is NULL for these records.

If you want to show BPF for these records which Process id is NULL, you need to call following JS in the form load event.

function setProcessId() {
var processId = Xrm.Page.context.getQueryStringParameters().process;
if (processId == null) {
//Business Process Flow Id
var procesGuid = '03278623-2923-443A-957C-AF56D1B1FC81';
Xrm.Page.data.process.setActiveProcess(procesGuid, function callbackFunction() { });
}
}
Advertisements

How to change the DashboardSettings of maximum controls limit in Dynamics CRM2011/2013

The maximum number of controls allowed on CRM2011 or CRM 2013 dashboards is 6. You cannot put the more than 6 graphs/charts/iframes/web resources etc. on the dashboard.

We can extend the number of controls as per the user needs. This setting is applied to the server not a organization setting. So you cannot change this setting for CRM Online but you can change this for an on-premise installation.

Option 1: Using Window Power Shell we can achieve it.

  1. Open the Windows Power Shell command window
  2. Add the Microsoft Dynamics CRM PowerShell snap-in using

Add-PSSnapin Microsoft.Crm.PowerShell
Sometimes You may get the message saying something like “Add-PSSnapin : Cannot add Windows PowerShell snap-in Microsoft.Crm.PowerShell because it is already added.” It is fine no problem.

3.  Run the following 3 commands

$setting = Get-CrmSetting -SettingType DashboardSettings

$setting.MaximumControlsLimit = 10

Set-CrmSetting -Setting $setting

After that open CRM, still you will be see only 6 components on the dashboard design, however you can add extra components based on how much you have set the limit.

Once you crossed the limit you will get following error message.

DashboardSettings

Option 2: If Powershell does not work, use following C# code to do the same

  public static void UpdateDashboardSettings()
        {
            //Create Instance of Deployment Service
            DeploymentServiceClient service = Microsoft.Xrm.Sdk.Deployment.Proxy.ProxyClientHelper.CreateClient(new Uri("http://CRMServer/Organization/XRMDeployment/2011/Deployment.svc"));
            //Use Default network Credentials(User should de Deployment Admin in Deployment Manager and System Admin in CRM)
            service.ClientCredentials.Windows.ClientCredential = (NetworkCredential)CredentialCache.DefaultCredentials;

            //Retrieve Current Dashboard Settings MaximumControlsLimit
            Microsoft.Xrm.Sdk.Deployment.RetrieveRequest retrieveReq = new Microsoft.Xrm.Sdk.Deployment.RetrieveRequest();
            retrieveReq.EntityType = DeploymentEntityType.DashboardSettings;

            Microsoft.Xrm.Sdk.Deployment.RetrieveResponse retrieveRes = (Microsoft.Xrm.Sdk.Deployment.RetrieveResponse)service.Execute(retrieveReq);
            if (retrieveRes != null && retrieveRes.Entity != null)
            {
                DashboardSettings dsCurrentResult = (DashboardSettings)retrieveRes.Entity;
                if (dsCurrentResult != null)
                    Console.WriteLine("Current DashboardSettings MaximumControlsLimit is " + dsCurrentResult.MaximumControlsLimit);
            }
            //Update Current Dashboard Settings MaximumControlsLimit = 10
            Microsoft.Xrm.Sdk.Deployment.UpdateRequest updateReq = new Microsoft.Xrm.Sdk.Deployment.UpdateRequest();
            DashboardSettings ds = new DashboardSettings();
            ds.MaximumControlsLimit = 10;
            updateReq.Entity = ds;
            Microsoft.Xrm.Sdk.Deployment.UpdateResponse updateRes = (Microsoft.Xrm.Sdk.Deployment.UpdateResponse)service.Execute(updateReq);

            //Retrieve again after updating Current Dashboard Settings MaximumControlsLimit
            Microsoft.Xrm.Sdk.Deployment.RetrieveRequest retrieveReq1 = new Microsoft.Xrm.Sdk.Deployment.RetrieveRequest();
            retrieveReq1.EntityType = DeploymentEntityType.DashboardSettings;
            Microsoft.Xrm.Sdk.Deployment.RetrieveResponse retrieveRes1 = (Microsoft.Xrm.Sdk.Deployment.RetrieveResponse)service.Execute(retrieveReq1);

            if (retrieveRes1 != null && retrieveRes1.Entity != null)
            {
                DashboardSettings dsUpdatedResult = (DashboardSettings)retrieveRes1.Entity;
                if (dsUpdatedResult != null)
                    Console.WriteLine("After Updating DashboardSettings MaximumControlsLimit is " + dsUpdatedResult.MaximumControlsLimit);

            }
        }

NOTE: You need add microsoft.xrm.sdk.deployment DLL from SDK to access those Deployment classes and methods. User who is running this should be Deployment Admin in Deployment Manager and Sys Admin in CRM

Incase if you are getting 404 error while accessing Deployment service, you need to check your CRM web server IIS settings and make sure XRMDeployment is not configured in Hidden Segments in IIS, Follow below steps to remove/add XRMDeployment setting in IIS

  1. Open Internet Information Services(IIS) Manager
  2. Expand Server on left navigation
  3. Expand Sites on the Left Navigation
  4. Click on Microsoft Dynamics CRM
  5. Click on “Request Filtering” icon in IIS on right side window
  6. Click on “Hidden Segments” tab on Request Filtering window on right side
  7. If “XRMDeployment” exists then select “XRMDeployment” and right click on “Remove” and say “Yes” to remove “XRMDeployment” from Hidden Segments
  8. Once you are done executing PowerShell, SDK Code you can add using “Add Hidden Segment” option, enter “XRMDeployment” in Hidden Segment window and click on “OK” to close the window.

Build dynamic HTML table and display on entity form using JavaScript and HTML web resource in Dynamics CRM 2011

I have a requirement to build dynamic HTML table and display on Account form using HTML web resource and JavaScript.

Here is my scenario; I have two entities; Account and AccountService. There is 1:N relationship between Account and AccountService. AccountService entity has name and account fields. Requirement is to get account services from AccountService entity based on account guid and display on Account form.

I have created new HTML web resource for displaying account services and added on Account form.

Here is HTML web resource code, I am using oDATA and JavaScript in HTML web resource.

 

<html>
<head>
    <title>Account Services</title>
    <script src="ls_Script_JQuery_1.7.1.min"></script>
    <script src="ClientGlobalContext.js.aspx"></script>
    <script language="javascript" type="text/javascript">
        function loadAccountServices() {
            //Get Account Guid
            var accountId = window.parent.Xrm.Page.data.entity.getId();
            //Get Account Services
            var accountServices = getAccountServices(accountId);
            if (accountServices != null && accountServices.length > 0) {
                var tableData = "";
                for (var i = 0; i < accountServices.length; i++) {
                    var service = accountServices[i].ls_name;
                    if (service != null) {
                        //dynamically add table data with Service Names
                        tableData = tableData + "<tr><td>" + service + "</td></tr>";
                    }
                }
                //Create HTML table
                var table = "<table style='font-family:Segoe UI;font-weight:normal;font-size:13px;'><tr style='height:20px'><td style='text-decoration:underline;'>Account Services</td></tr>" + tableData + "</table>";
                //show table data on the Account form
                window.document.writeln(table);
            }
        }
        //get Account Services
        function getAccountServices(accountId) {
            var serverUrl = location.protocol + "//" + location.host + "/" + Xrm.Page.context.getOrgUniqueName();
            var oDataUri = serverUrl + "/xrmservices/2011/OrganizationData.svc/ls_accountserviceSet?$select=ls_name&$filter=ls_Account/Id eq guid'" + accountId + "'";
            var accountServices = null;
            $.ajax({
                type: "GET",
                contentType: "application/json; charset=utf-8",
                datatype: "json",
                url: oDataUri,
                async: false,
                beforeSend: function (XMLHttpRequest) {
                    XMLHttpRequest.setRequestHeader("Accept", "application/json");
                },
                success: function (data, textStatus, XmlHttpRequest) {
                    if (data != null && data.d.results.length > 0) {
                        accountServices = data.d.results;
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }
            });
            return accountServices;
        }
    </script>
</head>
<body onload="loadAccountServices();">
</body>
</html>


How it looks on Account Form:

Account Services

Dynamics CRM 2013 SDK version 6.0.4 available

Microsoft Dynamics CRM 2013 latest SDK Version SDK Version 6.0.2 is now available on MSDN download center.

The following table lists the significant changes made to this version of the SDK.

New and updated topics Description of changes
SDK\Bin Updated the assemblies for Microsoft Dynamics CRM 2013 Update Rollup 2. These assemblies are also compatible with the latest service update for Microsoft Dynamics CRM Online.
SDK\Bin\SolutionPackager.exe Fixed the issue where Solution Packager failed to repack solutions that contain entity level business rules.
Authenticate the user with the web services
Walkthrough: Register a CRM app with Active Directory
Sample: Windows 8 desktop modern SOAP app
Sample: Windows 8 desktop modern OData app
Updated the documentation to include use of Active Directory Federation Services (AD FS) 3.0.
Configure email for incoming messages
SampleCode\CS\BusinessDataModel\
BusinessManagement\ConfigureQueueEmail.cs
SampleCode\VB\BusinessDataModel\
BusinessManagement\ConfigureQueueEmail.vb
Documented deprecated and read-only attribute changes for the email user name and password attributes in the Queue and UserSettings entities.

Changed the sample code, removing the lines of code that set the attributes.

Create a custom workflow activity Removed support for Microsoft .NET Framework 4.5. Added the requirement to digitally sign the assembly.
Install or uninstall the Developer Toolkit Added a statement that the Developer Toolkit can’t be installed into the Express edition of Microsoft Visual Studio.
Xrm.Page.ui (client-side reference) The Xrm.Page.ui.getCurrentControl method is deprecated in Microsoft Dynamics CRM 2013 Update Rollup 2.

Microsoft Dynamics CRM 2013 Update Rollup 2 is available

Update Rollup 2 for Microsoft Dynamics CRM 2013 is available.

Check out Microsoft KB article Rollup 2 for Microsoft Dynamics CRM 2013 KB Article

This rollup is available for all languages that are supported by Microsoft Dynamics CRM 2013.

Update Rollup 2 introduces support for the following:

  • Windows 8.1 and Internet Explorer 11 using CRM 2013 web application and CRM for Tablets
  • iOS7 support with Safari on iPad using the web application
  • Support for Safari using web application and CRM for Tablets using the tablet app for iPad Air
  • Windows Server 2012 R2 for CRM Server

Download link for Microsoft Dynamics CRM 2013 Update Rollup2: http://www.microsoft.com/en-us/download/details.aspx?id=42272

Keyboard shortcuts in Dynamics CRM 2013

The following table provides keyboard shortcuts used in Dynamics CRM 2013. The shortcut keys described in this section refer to the U.S. keyboard layout.

To Press
Move to the next option, option group, or field Tab
Move to the previous option, option group, or field Shift+Tab
Complete the command for the active option or button Enter
Move between options in an open list, or between options in a group of options Arrow keys
Cancel a command, or close a selected list or dialog box Esc
Save Ctrl+S or Shift+F12
Save and Close Alt+S
Cancel edits and close (Close) Esc
Open search Spacebar or Enter
Delete text from a field Backspace
Delete the record (when forms are in Edit mode) Ctrl+D
Save and then open a new form (Save and New) (when forms are in Edit mode) Ctrl+Shift+S
Open the lookup menu with the most recently used items in alphabetical order Alt+Down Arrow
Open the list menu (when forms are in Edit mode) Ctrl+Shift+2
Navigate to the next item on the list (when forms are in Edit mode) Ctrl+>
Navigate to the previous item on the list (when forms are in Edit mode) Ctrl+<
Open lookup drop-down list Enter
Close lookup drop-down list Esc
Auto-resolve lookup value Ctrl+K
Open a record found in lookup with forms in Edit mode Enter
Open a record found in lookup with forms in Read-optimized mode Ctrl+Enter
Add a step in the Sales Process Configuration Tool Al+Shift+N
Add a stage in the Sales Process Configuration Tool Alt+Shift+M
Tab to Command Bar when in the updated user experience Ctrl + [
Tab to process control when in the updated user experience Ctrl + ]
Tab to the Navigation pane Ctrl + Shift + 3
Tab to main work area when editing a form in the updated user experience Ctrl + Shift + 1

Tablets and Phones limitations and known issues in Dynamics CRM 2013

This topic describes issues and limitations that may be experienced when you run Microsoft Dynamics CRM 2013 for tablets, when you use a tablet and run Microsoft Dynamics CRM in a web browser, or when you use Microsoft Dynamics CRM for phones.

Tablet and phone limitations:

  • You can’t switch users when you run the CRM for tablets app or the CRM for phones app: The Microsoft Dynamics CRM for Windows 8, Microsoft Dynamics CRM for iPad, and CRM for phones apps can only run under the single user account that was set up when the application was installed. To change a user in the tablet or phone app, uninstall the app and then install the app again to specify the new user.
  • User credentials required for Microsoft Dynamics CRM 2013 (on-premises) mobile apps with AD FS versions earlier than Windows Server 2012 R2: Active Directory Federation Services (AD FS) in Windows Server 2012 R2 supports multi-factor authentication (MFA) that can be configured to let mobile Microsoft Dynamics CRM (on-premises) clients authenticate without prompting for user name and password credentials. Earlier versions of Active Directory Federation Services (AD FS) don’t support MFA and require credentials when a mobile Microsoft Dynamics CRM (on-premises) app client signs in.

Tablet known issues:

  • CRM (on-premises) URL doesn’t resolve on Nexus tablets: When you try to access Microsoft Dynamics CRM (on-premises) using an internal URL on a Nexus 10 tablet in the Chrome web browser, the URL doesn’t resolve and you can’t access the site. For example, a URL in the form of https://servername:5555 doesn’t resolve. This is a known issue with Android devices accessing IIS intranet sites. To work around this issue, select one of the following solutions.
  • CRM for tablets users are repeatedly prompted for sign-in credentials and can’t sign in: Users who try to sign in to Microsoft Dynamics CRM Server 2013 (on-premises) configured for Internet-facing deployment (IFD) using Microsoft Dynamics CRM for tablets are repeatedly prompted for credentials and can’t sign in. This issue occurs when the server running IIS where the CRM web application is installed has Negotiate and NTLM Windows authentication providers enabled on certain CRM website features. To resolve the issue, run a Repair of Microsoft Dynamics CRM Server on the server running IIS where the Web Application Server role is installed. To run this the CRM deployment must already be configured for claims-based authentication and IFD.
  • “Invalid user” error message when you try to sign in on a device that was recently used to sign-in by another user: When a user signs in to Microsoft Dynamics CRM and selects “Save email and password” using the CRM for Windows 8 app, another user may be unable to sign in to CRM using the device after the initial sign-in. This occurs even after the uninstall and reinstall that is required to change users on a tablet. This behavior occurs because the sign-in token must expire before another user can sign in using the same device. To work around this issue, either wait a period of time (48 hours by default) for the sign-in token to expire or sign in from another Windows 8 device.
  • Event 10001 messages appear in the Event Log when you run CRM for Windows 8 : The following event may be recorded multiple times to the Event Log, when ‘Show Analytic and Debug Logs’ is enabled, on the device where Microsoft Dynamics CRM for Windows 8 is running. Notice that, by default, ‘Show Analytic and Debug Logs’ is disabled in Event Viewer and these messages won’t be recorded.
    • Event Id: 10001
    • Message: SEC7131 : Security of a sandboxed iframe is potentially compromised by allowing script and same origin access.

    Verify the source of the messages. If the source is Microsoft Dynamics CRM Server, these events don’t pose a security threat and can be ignored.