Schedule anything with Universal Resource Scheduling

This slideshow requires JavaScript.

Schedule anything in Dynamics 365 using Universal Resource Scheduling. You can enable scheduling for any entity including custom entities.

For example, you can enable scheduling for the opportunity form and schedule marketing visits for your opportunities. You can also do this for the case form and schedule time to work on cases.

This is applicable for Sales, Customer Service, Field Service, Project Service Automation Continue reading “Schedule anything with Universal Resource Scheduling”

DLL merge and MSD CRM/365 (on-prem/On-Line)

Tips & Trics

While working as a developer, many times we will have some readymade tools or class libraries / DLLs, which were developed by some other developers and they publish for developer kind. Salute to their generosity.

We use those libraries in our development and our life becomes little easier. But while deploying it on other environments we have to install those things and or keep those DLLs on another environment, if we miss it then because of those open libraries, development breaks.

 

So in such conditions, we can merge multiple DLLs in one to make our life bit easier.

If it’s exe, user following function to make one DDL.

Advantage: it will keep the original identity of the DDL.

Disadvantage: it won’t work for the library building. For e.g. CRM plugins

Here is that great function …

private static void AsseblyResolveEvent()
 {
 AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
 {
 String resourceName = "AssemblyLoadingAndReflection." +
 new AssemblyName(args.Name).Name + ".dll";
 using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
 {
 Byte[] assemblyData = new Byte[stream.Length];
 stream.Read(assemblyData, 0, assemblyData.Length);
 return Assembly.Load(assemblyData);
 }
 };
 }

Curtsy: This function has written by Jeffrey Richter, here is his article for it.

If it’s DDL and or class libraries, ILMerge will useful.

Advantages: it’s free and lite installation. Easy to use.

Disadvantage: After merging DDLs with ILMerge, DDL will lose its identity, that’s why we can not use for CRM plugin libraries. While writing commands we need to bit careful else spelling mistake might frustrate you. ūüėČ

You need to install it after download from here. Then by following commands, you can merge multiple DDLs together.

Steps: Once its installed, open command window with admin rights and execute it, follow the commands

Step 1: Download ILMerge utility and install it in your machine
http://www.microsoft.com/en-us/download/details.aspx?id=17630

Step 2: Compile and Publish your Project to a folder (eg: C:\Publish\)

Step 3: Use the ilmerge command to merge the exe and dll files and output single exe file

ILMerge Command

Syntax (Simple*): ilmerge <input assembly 1> <input assembly 2> /out:<output file> /target:<dll|exe|winexe>

*For the complete set of options and syntax refer ILMerge Documentation

Example:

C:\Program Files\Microsoft\ILMerge>ilmerge C:\Publish\MyProgram.exe C:\Publish\MyLibrary.dll /out:C:\Publish\MyWinApp.exe /target:winexe /ndebug

ilmerge¬†‚Äď Command

MyProgram.exe¬†‚Äď Output from the published folder

MyLibrary.dll¬†‚Äď Any library used in the program

/target:winexe¬†‚Äď We need to output a single exe file for Windows Platform

/output¬†‚Äď Output folder and filename

/ndebug¬†‚Äď To disable debug (.pdb file)

Curtsy: Arun Ramchandran’s blog¬†, for more info, explore this link¬†and this link.

Above both options won’t be useful for MSD CRM or MSD 365. ūüėĒ

So, to make those libraries useful for these environments we have to create a folder in your plugin project so it will be part of plugin project. And we don’t need to merge it anymore. ūüėČ

Thus, we have two options available for it,

If those libraries are open source then we will get everything available online(thanks to generous great developers), just get only those classes which useful for you and ignore the rest of classes from that DDL.

But if it’s not open source then we need bit more efforts. As we need to use ILSpy or some similar add-on to decompile that code and then use in our plugin or workflow library.

There is another way for same is merging these files together along with its signature. Here are the details for it. (Courtesy: github )

Use Nuget to add ILMerge.MSBuild.Task to your Visual Studio project:

Install-Package ILMerge.MSBuild.Task

Also, install the ILMerge Package:

Install-Package ilmerge

Build your project. The merged assembly will be stored in an ILMerge folder under the project output.

Merge Assemblies With Copy Local = True

By default, all references with Copy Local equals true are merged with your project output.

Creating a Static List of Assemblies to Merge

It is also possible to use a static list of assemblies instead of inspecting the Copy Local property. This can be done through a configuration file added to the root of your project. Create a JSON file and name it as follows:

ILMergeConfig.json

The following snippet uses the InputAssemblies property to specify the files to be merged into the project output.

{
	"General": {
		"InputAssemblies": [
		  "$(SolutionDir)libs\\XrmUtils.Plugins.Abstractions.dll", 
		  "$(SolutionDir)libs\\XrmUtils.Plugins.Utilitiesd.dll" 
		]
	}
}

You don’t have to specify a path if assemblies are expected to be in the target directory:

{
	"General": {
		"InputAssemblies": [
		  "XrmUtils.Plugins.Abstractions.dll", 
		  "XrmUtils.Plugins.Utilities.dll" 
		]
	}
}

See Configuration File complete reference.

That’s it for now.

Thanks!

Few more ref

  1. http://develop1.net/public/post/2018/10/21/ILMergeNotSupported
  2. https://medium.com/capgemini-dynamics-365-team/using-gov-uk-notify-in-a-dynamics-crm-plugin-without-ilmerge-cf89f372cd5d 

Continue reading “DLL merge and MSD CRM/365 (on-prem/On-Line)”

Colourful MSD 365 Views/Grid

new things

Many times client ask to make views colourful based on some condition in MSD 365.

In earlier MSD CRM version, it was big and totally unsupported change. But now we can do the same thing in a supported way.

Here we need to create JavaScript library for this single function, as it won’t work if the same library has any other function (it’s strange, but happened with me). Well, here are the steps for it

  1. Create attribute or use existing option set, e.g. priority
    1. Option set text: Low, value: 15
    2. Option set text: Normal, value: 14
    3. Option set text: Critical, value: 12
    4. Option set text: Blocker, value: 11
    5. …and so on…
  2. Get colour images of 16X16 for each type e.g.
    1. Option set text: Low ==> Image: soft_Low
    2. Option set text: Normal ==> Image: soft_Normal
    3. Option set text: Critical ==> Image: soft_Critical
    4. Option set text: Blocker ==> Image: soft_Blocker
    5. …and so on…
    6. please no that its should be fine with all image type but i tried with PNG only 
  3. Create a JavaScript library in system keep below function
  4. Register this function on the view ==> Attribute (Priority). Here is the post for how to execute JavaScript on MSD 365 views.
  5. It will look like below …

colourful view

6. well, here is JavaScript function for your reference ….

//exe on incident view
function displayIconTooltip(rowData, userLCID) {

//alert(“..yes, its View Script..!!”);
var str = JSON.parse(rowData);
var col_data = str.soft_priority_Value; // this is the attribute name from system
var imgName = “”;
var tooltip = “{” + col_data + “}”;

switch (col_data) {
case 16: //it is optionset value
imgName = “img_VeryLow”;¬† // it’s image name from system
tooltip = “Very Low”;
break;
case 15:
imgName = “img_Low”;
tooltip = “Low”;
break;
case 14:
imgName = “img_Normal”;
tooltip = “Normal”;
break;
case 13:
imgName = “img_High”;
tooltip = “High”;
break;
case 12:
imgName = “img_Critical”;
tooltip = “Critical”;
break;

case 11:
imgName = “img_Blocker”;
tooltip = “Blocker”;
break;

default:
imgName = ” “;
tooltip = “N/A”;
break;

}
var resultarray = [imgName, tooltip];
return resultarray;

}

7. This same configuartion will work for MSD Gris as well..

color grid

Caution:

  1. Please note that this function will execute on each record one by one, so it may affect the performance.
  2. This configuration won’t work for Editable Grid.

Thanks!!

 

 

 

Editable Grid on Form and Workflow issue

new things

In the earlier post, it’s explained that how to make a view to be editable (Click here to explore that article). In this post, I will explain how to make any entity grid editable on form where it has been used as Sub-grid.

Its as well a simple configuration, here are the steps for it,

  1. First of all, that particulate entity must be enabled for an edit on entity level, if you don’t know how to make it, please explore it here.
  2. well, one entity is enabled for it now, open that particular form where you want make sub-grid as editable
  3. select that sub-grid and click on change property button on ribbon or simply double-click on that sub-grid. Refer below screenshot for same…..
  4. editble grid 4
  5. ¬†once you open Sub-grid property, please click on Control tab ==> Add Control, please refer below screen shot for it…..
  6. editble grid 5
  7. It will add control, now set the properties for the sub-grid for the form, ref below screenshot …..
  8. editble grid 6
  9. Now, please save and publish the entity.

 

but there is one issue with the editable grid when we add that on from then¬†Workflow dynamic values will be completely blank, just like below …

This slideshow requires JavaScript.

Resolution for the issue is…

  1. deactivate the editable grid form then create the workflow, re-activate the editable grid form
  2. Remove the editable grid feature from the form then create workflow and enable the editable grid feature on the form

That’s it!!

Thanks !!

JavaScript execution on View

new things

While working on MSD CRM or MSD 365, developer have to work with JavaScript and need to do a various thing with it on either of system.

Well, writing and executing it on forms it very straight forward but what about executing it on any View and do some stuff?

Doing this in earlier version was very big task and it was completely unsupported way.  But now Microsoft introduced it in supported way and its JavaScript configuration for views is as simple as JavaScript configuration for forms.

Well, this is exciting, here is the way for that configuration,

  1. open the view, where you want do some stuff with JS
  2. double click or click on ‘Change Properties’ button after selection of particulate column, ref below screen shot…..
  3. js on view 1
  4. here you can see new thing on the pop-up
    1. Web Resource lookup
    2. Function name text box
  5. Ref below screen shot…..
  6. js on view 2
  7. Browse you web resource for the system
  8. Provide you function name to execute on the view.
  9. Ref below screen shot…..
  10. js on view 3
  11. That’s it.

Thanks!! ūüôā

LinkEntity issue with ‘Partyid’

Today, I was working with LinkEntity for ‘PartyId’, So I want all appointment where specific account or contact is in the required field and is connected¬†to a specific entity.

Thus, I created 3 appointments on the entity and wrote following¬†query… Continue reading “LinkEntity issue with ‘Partyid’”

How can I work out the time spent in each stage of a business process?

Business Problem: I want to know how long is spent in my business process by stage and by user how can I achieve this with no code?

The solution is actually quite simple if you are the latest release of Dynamics 365. The key to the solution is the fact that Dynamics now maintains the active stage and active start time for instance of a business process flow. Continue reading “How can I work out the time spent in each stage of a business process?”

A Firefox Add On for MS CRM Users

Firefox have Add-in which is very helpful for MS CRM developers,  Just like Crom extension helps MS CRM developers. 

The CRM Power Pane is a helper tool designed to integrate with Microsoft Dynamics CRM application and allow you to manipulate forms or perform actions faster throughout the Microsoft Dynamics CRM application .

It has following features

power pane¬†for ex. you want to know the schema name of attribute, just click on ‘Schema name copy mode’ and then click on desired attribute, on mouse over it will show that name and on click that name will be copied on clipboard, as shown below..

power pane ex

also, if you want current record ID, just click on that option, id will be pop out. same like that you will get many other information without going in to the customisation mode with admin rights.

 

As well as you can unlock locked fields and put info there for testing purpose and save the form without making any customisation.

…. and many more.

To install it, go to Firefox add-ins and search for ‘Dynamis crm power pane’, then just install it …. and save your time ….

firefox power pane

 

Thanks you. !!

Linq Entity with filter

data retrival

Many times we need to joins with filters in one entity or both of them. Here is the simple sample …

Continue reading “Linq Entity with filter”

Error: AliasedValue – Key not found

Key not Found

Error: Key not found in Link Entity QueryExpression (Ref above image). Continue reading “Error: AliasedValue – Key not found”