Thursday, 11 January 2018

D365 V9 CRM SDK - SDK is reborn as Developer Guide - No more SDK download!


Microsoft is coming up with quite a bunch of sensible updates/features everyday. With the evolution around Dynamics space, we tend to witness updates around most of the existing areas and now it includes CRM SDK, 

What happened to SDK? No more SDK downloads!

SDK and the related documentations are replaced by Developer Guide . Developer Guide is a part of  docs.microsoft.com now and has all the needed documentation. 


Makes sense, but what happened to Plugin registration and other tools, bin assemblies and Sample code? 

Don't worry, Everything is still available but as standalone downloads


Where are the the plugin registration and other tools(Plugin registration tool, CrmSvcUtil, Configuration migration, Solution Packager, Package deployer, etc.,)

They are available as NuGet and can be downloaded using power shell scripts. The steps are as follows 

For more info refer this page from Microsoft docs and the below steps are copied from the same,

  1. In your Windows Start menu, type Windows Powershell and open it.
  2. Navigate to the folder you want to install the tools to. For example if you want to install them in a devtools folder on your D drive, type cd D:\devtools.
  3. Copy and paste the following PowerShell script into the PowerShell window and press Enter.
    $sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
    $targetNugetExe = ".\nuget.exe"
    Remove-Item .\Tools -Force -Recurse -ErrorAction Ignore
    Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
    Set-Alias nuget $targetNugetExe -Scope Global -Verbose
    
    ##
    ##Download Plugin Registration Tool
    ##
    ./nuget install Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool -O .\Tools
    md .\Tools\PluginRegistration
    $prtFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool.'}
    move .\Tools\$prtFolder\tools\*.* .\Tools\PluginRegistration
    Remove-Item .\Tools\$prtFolder -Force -Recurse
    
    ##
    ##Download CoreTools
    ##
    ./nuget install  Microsoft.CrmSdk.CoreTools -O .\Tools
    md .\Tools\CoreTools
    $coreToolsFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.CoreTools.'}
    move .\Tools\$coreToolsFolder\content\bin\coretools\*.* .\Tools\CoreTools
    Remove-Item .\Tools\$coreToolsFolder -Force -Recurse
    
    ##
    ##Download Configuration Migration
    ##
    ./nuget install  Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf -O .\Tools
    md .\Tools\ConfigurationMigration
    $configMigFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf.'}
    move .\Tools\$configMigFolder\tools\*.* .\Tools\ConfigurationMigration
    Remove-Item .\Tools\$configMigFolder -Force -Recurse
    
    ##
    ##Download Package Deployer 
    ##
    ./nuget install  Microsoft.CrmSdk.XrmTooling.PackageDeployment.WPF -O .\Tools
    md .\Tools\PackageDeployment
    $pdFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.PackageDeployment.Wpf.'}
    move .\Tools\$pdFolder\tools\*.* .\Tools\PackageDeployment
    Remove-Item .\Tools\$pdFolder -Force -Recurse
    
    ##
    ##Remove NuGet.exe
    ##
    Remove-Item nuget.exe    
    
  4. You will find the tools in the following folders:
  • [Your folder]\Tools\ConfigurationMigration
  • [Your folder]\Tools\CoreTools
  • [Your folder]\Tools\PackageDeployment
  • [Your folder]\Tools\PluginRegistration
To get the latest version of these tools, repeat these steps.


Where are the Sample codes and projects? 

They are available in the following Microsoft docs URL



Where are the assemblies? 

Assemblies are a part of NuGet package like the dev tools. Refer here for NuGet info


Hope this helps!

Source and Reference: Microsoft docs

Monday, 8 January 2018

{Know-How}MSCRM D365 JS - show or hide section using display name or label


Code Snippet to show or hide a Section using display name

Function to show or hide section


ToggleSection = function (tabName, sectionName, isVisible) {
    var tabs = Xrm.Page.ui.tabs.get();
    for (var i in tabs) {
        var tab = tabs[i];
        if (tab.getLabel() === tabName) {
            var sections = tab.sections.get();
            for (var s in sections) {
                var section = sections[s];
                if (section.getLabel() === sectionName) {
                    section.setVisible(isVisible);
                }
            }
        }
    }
};

Usage
ToggleSection("AdminTab","SectionName",false); //Hide
ToggleSection("AdminTab","sectionName",true); //Show

Note: The labels are case sensitive

{Know-How}MSCRM D365 JS - show or hide Tab using display name or label


Code Snippet to show or hide a Tab using display name

Function to show or hide Tabs


ToggleTab = function (tabName,isVisible) { 
    var tabs = Xrm.Page.ui.tabs.get();
    for (var i in tabs) {
        var tab = tabs[i];
        if (tab.getLabel() === tabName) {
            tab.setVisible(isVisible); 
        }
    }
};

Usage
ToggleTab("TabName",false); //Hide
ToggleTab("TabName",true); //Show

Note: The labels are case sensitive

Contact Form

Name

Email *

Message *