CRM On-Premise Archives - Aric Levin's Digital Transformation Blog http://aric.isite.dev/tag/crm-on-premise/ Microsoft Dynamics 365, Power Platform and Azure Thu, 12 May 2022 03:18:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 Advanced AutoNumber Source Code now available http://aric.isite.dev/dynamics/post/autonumber-enterprise-source-code-github/ Sat, 28 Mar 2020 01:00:00 +0000 https://aric.isite.dev/index.php/2020/03/28/advanced-autonumber-source-code-now-available/ A few years back we developed an AutoNumber solution that enables the implementation of AutoNumbers for Dynamics 365 and the Common Data Service. This AutoNumber solution allows the creation of rules for simple autonumbers with prefix, suffix and number of digits, but also has a lot of advanced features for getting numbers from related fields or option sets.

The post Advanced AutoNumber Source Code now available appeared first on Aric Levin's Digital Transformation Blog.

]]>
A few years back we developed an AutoNumber solution that enables the implementation of AutoNumbers for Dynamics 365 and the Common Data Service. This AutoNumber solution allows the creation of rules for simple autonumbers with prefix, suffix and number of digits, but also has a lot of advanced features for getting numbers from related fields or option sets.

These include:

  • Creating an AutoNumber for the current entity
  • Create an AutoNumber for an entity based a value in a related entity, and stores the AutoNumber in a text field in the entity
  • Create an AutoNumber for an entity based a multiple values of a related entity, and stores the AutoNumber in a text field in the entity
  • Create an AutoNumber for an entity based a value in an option set field, and stores the AutoNumber in a text field in the entity
  • Create an AutoNumber for an entity based a multiple values of an option set, and stores the AutoNumber in a text field in the entity

The source code, documentation and managed and unmanaged solutions are now available on Github, and can be downloaded from here:

https://github.com/ariclevin/autonumber/tree/master/Enterprise

The post Advanced AutoNumber Source Code now available appeared first on Aric Levin's Digital Transformation Blog.

]]>
Dynamics 365 Server version 9.0 available for download http://aric.isite.dev/dynamics/post/dynamics-365-v9-available-for-download/ Sun, 04 Nov 2018 19:29:00 +0000 https://aric.isite.dev/index.php/2018/11/04/dynamics-365-server-version-9-0-available-for-download/ A few days behind schedule, but the highly anticipated Dynamics 365 version 9.0 for On-Premise deployments is not available for download. Preview releases have been available for a while now via the Microsoft experience web site, but on 11/2 Microsoft made this release public.

The post Dynamics 365 Server version 9.0 available for download appeared first on Aric Levin's Digital Transformation Blog.

]]>
A few days behind schedule, but the highly anticipated Dynamics 365 version 9.0 for On-Premise deployments is not available for download. Preview releases have been available for a while now via the Microsoft experience web site, but on 11/2 Microsoft made this release public.

It is now available for download on the Microsoft Download center. A 90 day trial key can be used, or if you have a commercial license key you can enter that at any time (during setup or within the 90 days trial). This version includes the Reporting extensions, just like previous version. Also, be aware of supported operating systems. The system requirement mention requirement for Windows Server 2016, but just point to the Dynamics 365 Customer Engagement document site.

Download Link

The post Dynamics 365 Server version 9.0 available for download appeared first on Aric Levin's Digital Transformation Blog.

]]>
SharePoint Documents are back in Dynamics Portals October 2018 Release http://aric.isite.dev/dynamics/post/sharepoint-documents-dynamics-portals-october-2018/ Tue, 24 Jul 2018 13:38:00 +0000 https://aric.isite.dev/index.php/2018/07/24/sharepoint-documents-are-back-in-dynamics-portals-october-2018-release/ Ever since Microsoft purchased AdxStudios and replaced the product with Dynamics Portals, one of the biggest pains was the removal of SharePoint documents. The interim solution of course was available using Azure blobs with the Dynamics Labs solution which provided document uploads, but using the Out of the Box SharePoint Documents was a miss by a lot of Portal Developers.

The post SharePoint Documents are back in Dynamics Portals October 2018 Release appeared first on Aric Levin's Digital Transformation Blog.

]]>
Ever since Microsoft purchased AdxStudios and replaced the product with Dynamics Portals, one of the biggest pains was the removal of SharePoint documents. The interim solution of course was available using Azure blobs with the Dynamics Labs solution which provided document uploads, but using the Out of the Box SharePoint Documents was a miss by a lot of Portal Developers.

WIth the announcement of the October 2018 release of Microsoft Dynamics 365 (version number yet to be determined), which includes a mass number of features, one of the features that was included was management of SharePoint documents inside Dynamics portals.

This feature extends the document management capabilities of Dynamics 365 to portals, providing a consistent experience and allowing users to leverage their investment in SharePoint with Dynamics 365 for document management. Documents that are associated with entity records can be managed by portal users and stored in the SharePoint document library, providing seamless collaboration capabilities offered natively by SharePoint. SharePoint document libraries configured with entities in Dynamics 365 can be surfaced via the portal entity and web forms.

The additional of SharePoint documents for portals provides the following features:

  • Adding documents to a SharePoint Library via Portals
  • Viewing and downloading documents in a SharePoint Library via Portals
  • Creating folders in a SharePoint Library via Portals
  • Deleting documents in a SharePoint Library via Portals

The screenshot below shows adding a new file to the document library, a much cleaner interface than the existing Azure blob (notes) option.

Portal SharePoint Documents

Enjoy reading the new features that are available in the October 2018 release of Dynamics 365 available here. You can also download the 236 page pdf which contains the contents of the link and the features in this release.

The post SharePoint Documents are back in Dynamics Portals October 2018 Release appeared first on Aric Levin's Digital Transformation Blog.

]]>
Changing the details page link url for Entity Lists http://aric.isite.dev/dynamics/post/change-entity-list-details-page-link/ Thu, 12 Jul 2018 03:26:00 +0000 https://aric.isite.dev/index.php/2018/07/12/changing-the-details-page-link-url-for-entity-lists/ When displaying entity lists on a web page, there is usually a default column in a view which is displayed as a hyperlink. The link to the page is displayed based on the Web Page for Details View and the ID Query String Parameter Name attributes on the Entity List form (as shown in the image below). The problem is, what happens if my page that is displaying the Entity List already has query string parameters, and you want to keep those parameters on the next page that you are going to display.

The post Changing the details page link url for Entity Lists appeared first on Aric Levin's Digital Transformation Blog.

]]>
When displaying entity lists on a web page, there is usually a default column in a view which is displayed as a hyperlink. The link to the page is displayed based on the Web Page for Details View and the ID Query String Parameter Name attributes on the Entity List form (as shown in the image below). The problem is, what happens if my page that is displaying the Entity List already has query string parameters, and you want to keep those parameters on the next page that you are going to display.

Entity List Attributes

The Options tab on the Entity List form contains a custom JavaScript section, which we can control what happens when the document is loaded or when the grid refreshes/loads. We can use the $(“.entitylist.entity-grid”).on(“loaded”, function () { }) to process anytime the grid is reloaded, sorted or paged through. The image and code snippet below provide us with an example on how this can be accomplished.

Entity List Options (Javascript)

When the grid is loaded, we retrieve the existing query string and place it into a variable. We then loop through all the results of the table (entity list), by using the jquery each function. We get the current url that is in the anchor attribute, and append the existing query string to it. We finally write back to the anchor attribute the new url. The code below shows everything withing the document ready function.

$(document).ready(function () {
  $(".entitylist.entity-grid").on("loaded", function () { 
    var url = window.location.href;
    var queryStrings = url.substring(url.indexOf("?") +1);
    $("[href^='/business-info']").each(function(){
        var currentUrl = ($(this).attr('href'));
        var targetUrl = currentUrl + "&" + queryStrings;
        $(this).attr("href", targetUrl);
    });  
  });  
});  

If your page was start-business?id=999, when you click on the link the page you will be redirected to would be business-info?slid=12345678-1234-1234-1234-1234567890AB&id=999. The querystring from the previous page is now appended to the new page.

The post Changing the details page link url for Entity Lists appeared first on Aric Levin's Digital Transformation Blog.

]]>
Adding masking to form controls in Dynamics Portals http://aric.isite.dev/dynamics/post/dynamics-portals-textbox-masking/ Thu, 21 Jun 2018 13:21:00 +0000 https://aric.isite.dev/index.php/2018/06/21/adding-masking-to-form-controls-in-dynamics-portals/ It is a pretty known practice today, that when creating a web application that requests data from customers, certain fields are masked so that the system can prevent the entry of incorrect data. This has been done in desktop applications for a long time and is now also very common in web based applications.

The post Adding masking to form controls in Dynamics Portals appeared first on Aric Levin's Digital Transformation Blog.

]]>
It is a pretty known practice today, that when creating a web application that requests data from customers, certain fields are masked so that the system can prevent the entry of incorrect data. This has been done in desktop applications for a long time and is now also very common in web based applications.

Microsoft Dynamics Portals does not provide a way to implement this out of the box, but the path to implement this is simple and straight forward. The first thing that we need to do in order to get this working is get a jQuery mask plugin. The most common plugin that I have seen is the jQuery Mask Plugin created by Igor Escobar. It is available for download from github in the following link:

http://igorescobar.github.io/jQuery-Mask-Plugin/

Next we need to add that plugin to our Dynamics Portals application. In order to do this, I would refer you to a previously published article that I wrote called JavaScript Web Files in CRM Portals. You can read it on the Dynamics Community or my business web site using one of the links below:

https://community.dynamics.com/crm/b/briteglobalsolutions/archive/2018/05/02/javascript-web-files-in-crm-portals or https://www.briteglobal.com/blogs/community/portals-web-files/

Add the script file to the Tracking Code Content Snippet and upload it as a Web file so that it can be accessed across the application. At this point, the hard part is done. In the sample below, on the On my Entity Form Custom JavaScript, I will add the following code to mask my Tax Id and Social Security Numbers.

jQuery(function($){   
   $("#new_ein").mask("99-9999999");      
   $("#new_ssn").mask("999-99-9999"); 
});

The github site above contains plenty of examples for masking. The above was just a simple example. Finally, in the form that I would like to open, what I will see when I click on the control is the masking of the Tax Id number.

Dynamics Portal Masking

Next as I fill it out, it will only allow me to fill the numbers that I have specified in my jQuery function.

Dynamics Portals Masking

The post Adding masking to form controls in Dynamics Portals appeared first on Aric Levin's Digital Transformation Blog.

]]>
Using Placeholders in Portal Entity Form Text Controls http://aric.isite.dev/dynamics/post/using-placeholders-in-portal-text-controls/ Fri, 15 Jun 2018 23:32:00 +0000 https://aric.isite.dev/index.php/2018/06/15/using-placeholders-in-portal-entity-form-text-controls/ Recently I was working on a project, where the client needed all fields to have placeholders for accessibility reasons. When looking at the attribute metadata of the Entity Form, we are allowed to enter some text above or below the textbox control (or above the label), but the option is not available to prepopulate the control with some text when there is no data in it. After seeing a few community questions on how to implement this, I thought to share the solution.

The post Using Placeholders in Portal Entity Form Text Controls appeared first on Aric Levin's Digital Transformation Blog.

]]>
Recently I was working on a project, where the client needed all fields to have placeholders for accessibility reasons. When looking at the attribute metadata of the Entity Form, we are allowed to enter some text above or below the textbox control (or above the label), but the option is not available to prepopulate the control with some text when there is no data in it. After seeing a few community questions on how to implement this, I thought to share the solution.

Using JQuery we are able to easily add this functionality by using the attr function. The code sample below add placeholders for the Tax Id and Social Security Number fields. This code can be placed on either the Entity Form JavaScript section or on the Web Page JavaScript section.

$(document).ready(function () {
 // Add Placeholders for Tax Information
 $("#new_ein").attr("placeholder", "Enter your Tax Id Number" );
 $("#new_ssn").attr("placeholder", "Enter your Social Security Number" );
});

The screenshot below shows the result of displaying the placeholder on the Portal Form.

Dynamics CRM Portal Placeholder for Textbox

The post Using Placeholders in Portal Entity Form Text Controls appeared first on Aric Levin's Digital Transformation Blog.

]]>
Dynamics 365 and SharePoint Online Integration – CRM Implementation http://aric.isite.dev/dynamics/post/dynamics-365-sharepoint-online-integration-crm/ Sun, 06 May 2018 06:25:00 +0000 https://aric.isite.dev/index.php/2018/05/06/dynamics-365-and-sharepoint-online-integration-crm-implementation/ For the final part of the series, I am going to demonstrate and explain the portions that resides inside Dynamics CRM (or can possibly be built inside other applications). The solution includes an HTML web resource that contains a subgrid (using JQWidgets, but can be replaced with any third party jquery grid or bootstrap table). The subgrid contains a list of documents that are contained in SharePoint, and provides the functionality to upload or download additional documents.

The post Dynamics 365 and SharePoint Online Integration – CRM Implementation appeared first on Aric Levin's Digital Transformation Blog.

]]>
For the final part of the series, I am going to demonstrate and explain the portions that resides inside Dynamics CRM (or can possibly be built inside other applications). The solution includes an HTML web resource that contains a subgrid (using JQWidgets, but can be replaced with any third party jquery grid or bootstrap table). The subgrid contains a list of documents that are contained in SharePoint, and provides the functionality to upload or download additional documents.

There are a few custom entities which assist in the design of the layout of the subgrid, and well as javascript files that make up this logic.

The main different between this and the SharePoint grid is the ability to add additional attributes to the files that are being uploaded (as they are being uploaded).

The image below shows the subgrid that is displayed when the form loads. These documents have been uploaded from the subgrid web resource, and notice that the following attributes are also contained as part of the results: Account Name, Account Number and Document Type.

SharePoint Grid

When uploading a new document, the application pops up a File Upload control with a picklist to select the document type that will be uploaded (as shown below).

SharePoint Grid File Upload

When the document is uploaded, the Account Id, Account Number, Account Name and Document Type are set as attributes in the SharePoint folder. Also, all the documents that are pertaining to a single record within Dynamics, are uploaded to a single folder within SharePoint. The folders are Grouped by Entity Name and Entity Id, so that they are unique. The image below shows how the documents look in SharePoint after they are uploaded.

SharePoint Document View

From the previous posts, the entire solution requires Configuration of SharePoint, Configuration of Azure, Development of the Web Api and the development of the HTML Web Resource. I am providing the source code of the entire implementation has been uploaded to my public github repository, and is available for download along with the CRM (Dynamics 365 v9) solution.

This is a customizable solution and requires certain configuration, so not really for the faint of heart.

Hope you enjoy this.

The post Dynamics 365 and SharePoint Online Integration – CRM Implementation appeared first on Aric Levin's Digital Transformation Blog.

]]>
JavaScript Web Files in CRM Portals http://aric.isite.dev/dynamics/post/portals-web-files/ Thu, 03 May 2018 04:31:00 +0000 https://aric.isite.dev/index.php/2018/05/03/javascript-web-files-in-crm-portals/ As in any project, either CRM or Web application, the requirement to have JavaScript libraries that can be accessed across multiple files is common. In Dynamics 365 Portals, the use of Web Files is how we have the ability of create files that will be shared across the entire portal, or possibly only sections of the Portal. These common files are stored in the Web Files entity. This issue is that when we try to add a JavaScript web file, we get an error that the attachment is blocked. Web Files use the Notes entity to store the actual files that we add to the Web File entity. 

The post JavaScript Web Files in CRM Portals appeared first on Aric Levin's Digital Transformation Blog.

]]>
As in any project, either CRM or Web application, the requirement to have JavaScript libraries that can be accessed across multiple files is common. In Dynamics 365 Portals, the use of Web Files is how we have the ability of create files that will be shared across the entire portal, or possibly only sections of the Portal. These common files are stored in the Web Files entity. This issue is that when we try to add a JavaScript web file, we get an error that the attachment is blocked. Web Files use the Notes entity to store the actual files that we add to the Web File entity.

The error that we get when we attempt to do this is:

Attachment blocked: The attachment is not a valid file type.

How do we resolve this? The standard Dynamics 365 System Settings is configured to block a large set of extensions for uploading attachments for both email and notes, and this includes of course the .js attachment. The reasoning behind this is that JavaScript extensions could be used to execute unsafe code. Since the JS files that we want to add was created by us, and most likely will not cause any harm, we can modify this System Setting to allow us to upload js files.

If we navigate to Settings -> Administration, and click on System Settings, the System Settings dialog will pop up. On the General tab, under the section Set blocked file extensions for attachments, there is a long list of file extensions that are blocked from being uploaded to notes (annotations).

System Settings - Attachment Extensions

Find the js extension and remove it (include the semicolon that follows it – js;). Remember that it appears after the jar extension. Press OK to Save your changes.

Once you have made the change, you should be able to upload your JavaScript file again to the Web Files entity. If you created the Web File record previously simple update it and add the new attachments. You should keep only a single attachment per web file to simplify things.

After the Web File has been added, you can add the files to your code, by modifying the Tracking Code Content Snippet. Navigate to Content Snippets entity, and Find Tracking Code record. Open the record, and in the Value enter the following code:

<script src="/folder/filename.js"></script>

At this point, the js file should be accessible on the portal, and the functions of the js file can be accessed from within web templates or web pages.

The post JavaScript Web Files in CRM Portals appeared first on Aric Levin's Digital Transformation Blog.

]]>
Creating Web Resource with a Lookup Control http://aric.isite.dev/dynamics/post/creating-web-resource-with-lookup-control/ Sun, 11 Mar 2018 05:45:00 +0000 https://aric.isite.dev/index.php/2018/03/11/creating-web-resource-with-a-lookup-control/ A few years ago we had some requirements where we needed to pop up an html web resource where users could select a value from a related entity (in a manner similar to a lookup control). We originally developed this as a regular drop down and retrieving the values using Rest messages, but later on decided to change this and have the user click on a "lookup" style control inside the web resource to get this working.

The post Creating Web Resource with a Lookup Control appeared first on Aric Levin's Digital Transformation Blog.

]]>
A few years ago we had some requirements where we needed to pop up an html web resource where users could select a value from a related entity (in a manner similar to a lookup control). We originally developed this as a regular drop down and retrieving the values using Rest messages, but later on decided to change this and have the user click on a “lookup” style control inside the web resource to get this working.

In the recent weeks I saw a few posts in the community of people asking how to do this. In this article I will demostrate the logic of implementing this.

The first thing is we are going to need to create an Entity for the purpose of this solution, and add a button to the entity form to popup the message. We created an entity called Area Type and added a button to the entity called Change Owner using Ribbon Workbench. The button itself will call a JavaScript function that is called changeOwner.

Area Type and Change Owner

The Change Owner function contains the code snippet below which calls the dialog and also processes the changes from the callback of the dialog. I am using the Xrm.Internal.openDialog to open the web resource, and yes “I am aware that this is not supported”, but this is still working in Dynamics 365 v9, and you can feel free to modify the calling of the web resource. Once the button is clicked the popup window will open.

function changeOwner()
{
    var DialogOption = new Xrm.DialogOptions;
    DialogOption.width = 600; DialogOption.height = 550;
    Xrm.Internal.openDialog("/WebResources/xrm_dialog.htm", DialogOption, null, null, changeOwnerCallback);
}

function changeOwnerCallback(returnValue) {
    if (returnValue != null) {
		
		// If need to return multiple values;
	    var returnValues = returnValue.split(':');
        var ownerId = returnValues[0];
        var ownerName = returnValues[1];
		// Perform Actions on return values
		setLookup("ownerid", ownerId, ownerName, "systemuser");
    }
}

Since this was used in a previous project that we had, there is a text box for comments and the lookup control that will need to be popped up.

Web Resource/Dialog Window with Lookup Control

When the user clicks on the lookup icon in the dialog window, an additional Lookup Record window will pop up on top of the original dialog window.

function openOther() {

	var imgButton = $("#crmOtherLookup").attr("src");
	if (imgButton == "/_imgs/btn_off_lookup.png") {


		var objectTypeCode = 8;
		var url = "/_controls/lookup/lookupinfo.aspx?AllowFilterOff=0&DefaultType=8&DefaultViewId=%7bE88CA999-0B16-4AE9-B6A9-9EDC840D42D8%7d&DisableQuickFind=0&DisableViewPicker=1&IsInlineMultiLookup=0&LookupStyle=single&ShowNewButton=0&ShowPropButton=0&browse=false&dType=1&mrsh=false&objecttypes=8";

		var DialogOption = new Xrm.DialogOptions;
		DialogOption.width = 500; DialogOption.height = 400;
		Xrm.Internal.openDialog(url, DialogOption, null, null, openOtherCallback);
	}
	else {
		alert("Please select the radio button to the left of Other in order to select a system user.");
	}
}

function openOtherCallback(returnValue) {
	if (returnValue != null)
	{
		if (returnValue.items.length > 0) {
			var guid = returnValue.items[0].id;
			var name = returnValue.items[0].name;
			$("#crmOtherLookup_ledit").val(name); // text 
			$("#crmOtherLookup_lId").val(guid); // hidden                    
		}
	}
}

Select User

Select the User record that you want, and click the Add button to populate the values from the lookup window (as shown below):

Populated Lookup Control

Finally press the OK button to have the data from the lookup returned to the form, and update the original lookup field that is on the form (not required).

function applyChanges() {
	var returnValue = "";

	var message = $("#crmRoutingMessage").val();
	if (message != '') {

		var otherId = $("#crmOtherLookup_lId").val();
		var otherName = $("#crmOtherLookup_ledit").val();
		returnValue = otherId + ':' + otherName; 

		Mscrm.Utilities.setReturnValue(returnValue);
		closeWindow(true);
	}
	else
	{
		alert('Please enter a Routing Message');
	}
}

Final Result

The full source code and a sample solution (containing the test entity, customizations and all web resource files) is available here on github: https://github.com/ariclevin/WebResourceLookup

The post Creating Web Resource with a Lookup Control appeared first on Aric Levin's Digital Transformation Blog.

]]>
Global Cloning functionality for Dynamics 365 http://aric.isite.dev/dynamics/post/global-cloning-for-dynamics-365/ Thu, 15 Feb 2018 05:28:00 +0000 https://aric.isite.dev/index.php/2018/02/15/global-cloning-functionality-for-dynamics-365/ Recently I had a requirement to provide cloning capabilities for one of the projects that I was working on. It wasn't so simple as to just clone an individual record, but also provide the ability to clone the relationships.

The post Global Cloning functionality for Dynamics 365 appeared first on Aric Levin's Digital Transformation Blog.

]]>
Recently I had a requirement to provide cloning capabilities for one of the projects that I was working on. It wasn’t so simple as to just clone an individual record, but also provide the ability to clone the relationships.

This is where it becomes tricky, as some entities cannot be easily cloned due to some of the restrictions, so we wanted to provide this solution the ability to restrict certain actions from happening. For example, the address1_addressid and address2_addressid fields in the Account and Contact entities cannot be cloned as they point to the Customer Address record, so the Guid there has to be unique.

So for the first scenario, we needed to provide the system with the ability to restrict certain fields from being cloned, by providing a status of Active or Inactive, the cloning solution will decide whether or not to clone the record. The screenshot below shows the Clone Settings entity, with the list of attributes that are available for cloning. Notice the highlighted row is marked as Inactive., which means it will not be cloned.

Clone Settings Entity

Next we had to deal with relationships. One of the issue with relationships is that there are probably many relationships that you do not want to be cloned. In the related entities, we provided 3 statuses: Duplicate, Reassociate or Inactive. The Inactive option skips the cloning procedure for the relationship. The Duplicate will make a duplicate of the record Related entity record and the Reassociate will reassociate the related lookup from the source record to the cloned record.

Clone Relationships

We modifies the application ribbon so that the Clone button will appear on every entity (based on a webapi call to check if the entity is enabled for cloning in the Clone Settings), and added a global script library for this purpose on for calling the Clone action. The end result is as follows.

Original and Cloned records

This solution works for our purpose, but I would consider it a Beta Release for anyone who is interested in source code. It’s available on github, so you can make whatever changes that you want. I will add instructions on how to use sometime soon.

The post Global Cloning functionality for Dynamics 365 appeared first on Aric Levin's Digital Transformation Blog.

]]>