Skip to main content

Posts

Showing posts from 2017

Dynamics Set IFrame URL - D365 v8 vs. D365 v9

While doing client work, I came across a problem with setting an IFrame URL dynamically.  The underlying issue was that the sandbox instance is on v8 of Dynamics 365 and production is on v9 of Dynamics 365.  The reason for this was because this client was setup around the time that Microsoft rolled out v9.  Anyways, JavaScript that I wrote to dynamically set the URL of the IFrame wasn't working in the v9 instance.  This was because of changes that Microsoft made to how IFrames are loaded on the form and also changes to JavaScript.

Here is my v8 setup:
JavaScript runs OnLoad of contact form.  This works because of how IFrames are loaded in v8.  You can also run it on either a tab change (hide / show) or OnReadyStateComplete event of the IFrame.  Depending on your setup you will need to choose which is best for you.  For me in this case it was the OnLoad event.Here is the JavaScript: function OnLoad() { //Get memberid var value = Xrm.Page.data.entity.attributes.get…

Using Stream Deck with SCRIBE

Because I am doing a lot of work with SCRIBE Online, I find myself trying to come up with solutions to speed up my work.  One solution I came up with is using my Stream Deck to automate some of the commands I type within SCRIBE Online.  Before we go to far let me bring you up to speed on what the Stream Deck is.

The Stream Deck is manufactured by elgato.  It is a small 15 key keyboard that can be customized.  What I like about it is how the keys are clean looking and can be easily changed by the application.  This hardware is marketed towards video editors and game streams (both of which I don't do).   I got it because of the number of keys it has, the ease at which you can update it, and because I didn't want to use macro's on another external keyboard with paper labels stuck on the keys.

I will say that I am not only using the Stream Deck for just SCRIBE, but other applications like Visual Studio, Microsoft Windows shortcut keys, and to launch other applications.  The re…

Lookup Tables

While creating data mappings you may run into the need to store some variables in a table in a Key \ Value Pair.  This way you can call the variable by its Key to get the Value and pass it to the other system.  This is helpful when the 2 systems store data in different ways.  An example of this would be a table that stores United States abbreviations as the key and the full state name as the value.  This is helpful when the source stores the full state name and the target stores the abbreviation or visa versa.  So how do we set this up?

1) In the navigation bar click on "MORE".
2) Click on "Lookup Tables".
3) Click on the "+" sign on the right hand side.
4) In the pop-up input a Name.
5) On the ellipses button on the right under Description you will get a dropdown with "Create", "Append" and "Export".
     5.1) Create - Click this to create a new Key / Value Pair in the table.
     5.2) Append - If you have a CSV file already…

Option Set Helper Code

When it comes to working with Option Sets while creating a plugin, custom workflow activity or other extension to CRM, it can sometimes be a pain to get the label of the Option Set.  There are many solutions out there on how to accomplish this, but for the most part they were not reliable.  So after doing a bunch of research online and going through the SDK I came up with 4 methods that help me when I am working with Option Sets.  There are 2 for global option sets and 2 for local option sets.  The reason there are 2 for each is because one method will return the value and the other will return the label.

1) Get Local Option Set Label - This method will return the label of the option set value you provide it.
/// <summary> /// Method to get local option set label /// </summary> /// <param name="entityLogicalName">Schema name of entity</param> /// <param name="optionSetName">schema name of the optionset<…

XrmToolBox Bulk Attachment Manager - Version 1.0.1.0

I am pleased to announce that today I have published version 1 of my Bulk Attachment Manager plugin for XrmToolBox.  This is an open source plugin that I created because I had a need multiple times to migrate attachments out of CRM and into another system.  because of the way CRM stores attachments in the database, migrating these are sometimes hard said then done.  So to make this process easy I came up with this tool.  Before I go any further I am sure you want the important links so you can take a look.  Here they are:

GitHub Project
Project Wiki
Nuget Package

Right now, this plugin can only download note attachments from CRM.  In future releases I will turn on email attachment downloads and note attachment uploads (notes will need to already exist in the system).  To download note attachments, you have 2 options and that is to either download all note attachments or only select note attachments.  To download only select note attachments, you will need to provide a .csv file with guid…

Using SCRIBE Online For Scheduled Tasks

While doing client work, I ran into a need where we needed to scan for records where a date value is 3 months in the future (i.e. 3 months from today) in Microsoft Dynamics 365.  There are a few options to accomplish this:
Microsoft Dynamics 365 SDK (Developer Guide)Timed workflowsSCRIBE Online The issue with using the Microsoft Dynamics 365 SDK (Developer Guide) is you need a software developer to create a console application that is linked to a Windows scheduled task to run every night to connect to CRM, query the records and make the changes.  This means if you need any updates to the application you need to developer to change source code.  This is a viable option if you have an internal development team that can support the application.
When it comes to using timed workflows with wait statements, we would need to have the workflow fire at a specific time in the record.  In this scenario, this means that the workflow needs to fire to start the countdown (wait) when the record was c…

SCRIBE Online Training and Resources

SCRIBE Online is a massive tool that can be intimidating the first time you work with it.  Luckily SCRIBE provides a lot of documentation and training to help you get started with your first go with SCRIBE Online.  When I first started working with SCRIBE Online it was in what they call the "Classic UI".  The latest version of SCRIBE is called "Crystal UI"  I will say that there where a lot of changes between classic and crystal that took me a little bit to grasp.  But, SCRIBE does a great job putting out content to help new users and even experienced users keep up to date with the platform.

In this post I wanted to go over some of the resources that SCRIBE offers to everyone for free.  This way you can get started with your first mapping or refresh your knowledge of SCRIBE Online.  First, we will talk about their webinars.  SCRIBE does regular webinars about its platform.  Past webinars can be found here.

Next, SCRIBE provides excellent video tutorials for SCRIBE …

SCRIBE Online Status Monitor

When working with cloud solutions it's always important to understand the options you have available to monitor that service.  For SCRIBE Online, they have a website you can go to to see the current status of:

AgentsAPIConnectorsEvent SolutionsUser InterfaceSandbox Not only can you see current statuses but you can also see information about current incidents and past incidents.  Also they offer the ability to sign up for alerts by email, text and RSS.  Personally, I am signed up for email and text alerts.  To help keep the team of people I work with update, I setup RSS notification within our Microsoft Team's account.  I also recommend that if you are a consultant, you make sure any client you have setup with SCRIBE of integrations, you let them know about this page.
Here are some helpful tips for working with the site: Subscribing To All Updates:
Navigate to https://trust.scribesoft.com/Click on "SUBSCRIBE TO UPDATES" buttonChoose how you want to subscribe:Envelope = …

Documenting Maps

When we are creating mappings in SCRIBE its important that we document those maps.  This is a two stage process.  First, we want to do an export of the map and save the JSON file into the source control system.  This way we have a back up copy of it and we can reuse the map if we need it again, similar to what you would do with a template.  The second reason is so others can have an understanding of the process.

In projects that I have worked on in the past I have taken more of a manual approach to creating the supporting documentation for my integration and migration mappings.  This can be time consuming to say the least.  During one of these exercises, I found the SCRIBE Documentation Tool.  I walk through the steps they outlined and it auto generated the documentation for me.  This has greatly speed up my work and gives me an spreadsheet that is easy to understand.

To create this documentation you will need a Google account as it uses Google Docs.  Here is a link to the detailed st…

Goodbye SDK...Hello Developer Guide

With the release of Microsoft Dynamics 365 version 9, we are saying goodbye to the large SDK we are use to downloading to extend Microsoft Dynamics and saying hello to the Developer Guide for Dynamics 365 Customer Engagement.  Here are some highlights with the version 9 release.

1) Previous SDK versions can still be downloaded for previous release of Microsoft Dynamics CRM

CRM 4.0CRM 2011CRM 2013CRM 2015Dynamics 365 Version 8 2) Per the Developer Guide Dynamics 365 Version 9 is an online only release.
3) To get the early bound generator, plugin registration tool and other CRM tools you will need to use PowerShell and Nuget to get them.  Here is a link provided by Microsoft on how to get these tools.
4) Webhooks have been added to the plugin registration tool.  This allows for easy integration with Azure Functions.
5) As a developer you will have the ability to download the Developer Guide into a PDF for offline viewing.  To do this simply click on the "Download To PDF" on the…

Setup Non-Interactive User with Non-Expiring Password

When we need to connect CRM to another system it is important that the connection remain working so data can flow easily between the systems.  One common issue that can arise in the integration is the user account we use to create the connection, password can expire.  When this happens it could be minutes to days before the issue is found and that can lead to data synchronization between the systems getting messed.  To migrate this risk we can easily setup a user with a non-expiring password.  The user type for this in CRM is "Non-Interactive".  Non-Interactive users can't log into CRM via the front end.  If you try you will see this error message:
The other benefit of using a non-interactive user account is it doesn't require a CRM license to work.  You will only need to assign a license to the account for about 5 minutes to setup the account for the first time.  After that you can remove it and it will remain active in CRM.  You are allowed to have 5 non-interactiv…

October 2017 SCRIBE Online Feature Spotlight - Find and Replace

On October 26th, 2017 SCRIBE pushed out the fall update to SCRIBE Online.  One of the first changes I took notice of was the "Find & Replace" feature.  For those who are not aware, in the past when importing a map backup (JSON or XML) into a different environment to use it as a template you would need to rename connections.  This required going into the JSON or XML file to do it in bulk.  For someone not versed in either, this could be an intimidating task. Well, SCRIBE has made this task even easier and in my opinion even safer.

First, if you don't see the "Find & Replace' in your mapping, please clear your cache of your browser and then close it.  Reopen your browser and you should see it now.  If you are still don't see it or see error messages, check out this troubleshooting article SCRIBE posted that can help.

When clicking on the Find and replace you will see the following:
Clicking on the down arrow between the search input and the ".*&q…

Updated To Version 1.7 - Azure Blob Storage For Storing Microsoft Dynamics 365 Attachments

In another post I talked about using Azure Blob Storage to store CRM attachments in Azure rather then in CRM.  Today I installed the app in a clients CRM system and found that Microsoft Labs updated the App to version 1.7.  This change had a lot of updates from UI to how to setup notes attachment movement.  Also they now allow for moving of existing attachments.  Here is the updated steps:

1) Go To AppSource
2) Install the Attachment Management App by clicking the "Get It Now" button under the image.
3) While its installing go to Azure and setup your blob storage account.
4) For each CRM instance you will need to setup 2 containers in your blob storage.  One is for email attachments and the other is for notes attachments.  So if you have a production instance and sandbox instance you will need to have 4 containers (DevEmails, DevNotes, ProdEmails, ProdNotes).  If you want to separate note attachments by entity, then create one container per entity.  The DevNotes or ProdNote…

Azure Blob Storage For Storing Microsoft Dynamics 365 Attachments

In my Living In SCRIBE Online Blog I talked about work I did to migrate CRM 4.0 on-premise to Dynamics 365 using SCRIBE Online.  In that blog I mentioned how there are about 80 GB worth of attachments that had to be moved into the cloud.  Well this could quickly get expensive if we stored them directly in CRM.  Also, this client wasn't using SharePoint.  So what option do we have to store this data so end users can access the data?  Why not use Azure Blob Storage?

Microsoft has an app in AppSource to move attachments from CRM to Azure blob storage.  Not only does it all for this, but it also has a web resource in it so you can allow for bulk uploads.  Here is how to set it up:

1) Go To AppSource
2) Install the Attachment Management App by clicking the "Get It Now" button under the image.
3) While its installing go to Azure and setup your blob storage account.
4) For each CRM instance you will need to setup 2 containers in your blob storage.  One is for email attachments …

SCRIBE Connector Development - Handling Array List

Are you working on creating a connector with SCRIBE's CDK?  In your connector do you have an array of strings or list of  strings that you need to pass?  SCRIBE makes this easy to do within the CDK and SCRIBE Online.

I came across this scenario on a connector I was creating that passes a JSON message to an API.  In the JSON message it had a list of strings for entity ID's. Here is an easy way to accomplish this:

1) Create you Property Definition as past or your Object Definition.
1: new PropertyDefinition 2: { 3: Description = "Use TOLIST() to pass in a list of entity id's.", 4: FullName = "Entity IDs", 5: IsPrimaryKey = false, 6: MaxOccurs = 1, 7: MinOccurs = 0, 8: Name = "PublishTo", 9: Nullable = true, 10: NumericPrecision = 0, 11: NumericScale = 0, 12: PresentationType = "string", 13: PropertyType = typeof(string).Name, 14: Use…

Using SCRIBE Online To Migrate From CRM 4.0 to Dynamics 365

Recently I had a client that needed to be migrated from CRM 4.0 on-premise to Dynamics 365 online.  First, I want to say that we opted to not do the upgrade to CRM 2011 on-premise to CRM 2013 on-premise to CRM 2015 on-premise to Dynamics 365 on-premise because the client wanted to start fresh with CRM customization's.  So personally, it would have been a waste of time to do that upgrade process.

The following issues where identified with the data migration:
1) CRM 4.0 is no supported by SCRIBE Online.
2) The server OS that CRM 4.0 and SQL Server ran on was not supported.
3) The version of SQL Server was no supported.

How am I going to migrate this data? Hmm.....

The solutions:
1) The RDP Terminal Server I am using has a supported server OS.
2) I am able to connect to SQL Server CRM 4.0 Database with ODBC.
3) Install SCRIBE On-Premise Agent on the Terminal Server and use the ODBC connector to retrieve the data.

By using the ODBC connector I could access the data in SCRIBE Online in a…

Creating Pre and Post Build Events For Connector Creation

While building a custom connector using the CDK I found it time consuming to have to manually stop the SCRIBE Agent service, copy the connector .dll to the connector folder in the agent folder and restart the service. To over come this I added some pre and post build functions to my project in Visual Studio. Here is how you setup your development environment to automate all this:

1) Right click on your project and go to properties.
2) On left side go to Build Events.
3) In "Pre-build event command line" input this:
1: net stop "Scribe Online Agent" 2: Exit /b 0 4) In "Post-build event command line" input this:
1: copy /Y "$(TargetDir)$(ProjectName).dll" "C:\Program Files (x86)\Scribe Software\AGENTNAME\Connectors\CONNECTORNAME\$(ProjectName).dll" 2: net start "Scribe Online Agent"
Replace AGENTNAME with the name of your agent and CONNECTORNAME with the name of the folder where you place the DLL file.
What this …

Using Session Memory with CRM Portals

Recently while doing some client work, we noticed that CRM Portals does a post back when adding information within a sub-grid on an entity form.  Why is this an issue?  Because, if you have input fields on the form, these values are not written into  CRM till the save button at the bottom of the form is clicked.  So if a user inputs anything into the sub-grid after they fill in the fields, the post back action will remove what the user input.  This can make for a bad user experience.  To over come this, we can use session memory to temporarily store the values till the browsing session is ended.

To use session storage the first thing we will need to do is register onChange handlers to update the values the session memory when the user changes a value.  Here are some examples of onChange handlers written in JQuery:
1: $(document).on('change', '#CHECKBOX ID', function () { SetSessionValue("#CHECKBOX ID") }); 2: $(document).on('change keyup paste', &#…

CRM Portals OnChange Event For DateTime

Occasionally when working with CRM Portals you may run into the need to get the OnChange event for a date time field.  Because of the way that CRM Portals renders date time fields this is slightly more complicated then working with text boxes, check boxes and pick lists.  During my process I ended up reaching out to Microsoft for help on this and below are the steps they provided to help me with this problem:

1) Click on the date time control
2) Press F12
3) In console type $('div.control') and hit enter (this will give you a list of div controls)
4) Locate the div control for the date time field














5) Go to the entity form or web page in CRM and add the following code snippet (replace the 2 with the number your div control is located at):

1: $(document).ready(function () 2: { 3: var dpcontrol = $('div.control')[2]; 4: $(dpcontrol).on("dp.change", function (e) 5: { 6: alert("On change Event Triggered")…