Skip to main content

Posts

Showing posts from 2018

Prevent NULL inserts during updates

Recently, I had an issue that I needed to overcome.  The problem was that the Dynamics 365 instance I was working on, was integrated with multiple other systems with some long running external processes and possible old data in the UI when a record is open, overriding what the value was set to from the external processes.  What was happening is that on create of a contact, we can have a NULL e-mail.  This is normal behavior.  Our external process would be running and update the NULL e-mail field while the record was open in the UI.  Because the UI hadn't been refreshed and the user made other changes, the e-mail would be blanked out (NULL).  To make sure that the field once populated (yes, this is a business requirement) could not be cleared, I wrote a small pre-operation plugin that does the following: Check's the plugin context to see if we are trying to update the emailaddress1 or emailaddress2.   If we are trying to update either email address.  Than we check to see if

Multi-Select Option Sets Missing setVisible() for JavaScript (Workaround)

It is common practice in Microsoft Dynamics 365 to use Business Rules to show and hide fields on a form.  But, with that addition of multi-select option sets, you can't do this.  So the next logical step is to use JavaScript.  There is just one small problem, there is no setVisible() function for multi-selection option sets.  Here are the controls we do have access too, as of this post: So, how can we dynamically show / hide multi select option sets?  The easiest way is to use a section.  Place a new section on you form.  Then you will need to use JavaScript to get the tab and section by name.  Once you have that, you can dynamically show / hide the section to make the multi-selection option set show and hide.  Here is an example of the JavaScript: function ShowHide(executionContext) { //Create the form context var formContext = executionContext.getFormContext(); var contactStatus = formContext.getAttribute("Field Name").getValue(); var tabOb

BETA Release Scribe .NET Library

In my spare time I have been building a .NET 4.5.2 library for the Tibco Scribe Online API.  For one developer this has been a daunting task and I am at the point that I need some help.  I have the library created and need people that can write unit tests to test the code.  The project is 100% open source and I am aiming for it to be a community build.  The project is hosted at GitHub . This is a BETA release, because I have not created all the unit tests to make sure every single method is bug free.  Make sure to check the wiki on how to implement the code and use the project.  Once we are out of Beta I will create the NUGET package. Thank you in advance to all that help out.

Dynamics 365 v9 Unit Testing and .NET Confusion

Recently while creating a plugin for Dynamics 365 v9, I ran into an issue trying to connect to CRM via the tooling connector in my unit test project.  The underlying problem was that the .NET version I was using in my unit test was 4.5.2.  This was preventing me from being able to connect to CRM to create my organization service.  I updated the .NET version on my unit test project to 4.6.1 and was then finally able to connect.  I will also add that I am using the latest nuget package version for Dynamics 365 v9. For consistence, I updated the plugin project I was working on to .NET 4.6.1.  Locally, everything was working great.  I was able to connect to CRM and make sure that all the methods I had written did what they where suppose to do using test driven development practices. Then when publishing my plugin via the latest version of the plugin registration tool, I received an error and could not publish my plugin.  The error was due to the .NET version of my plugin project not

Working With N:N Relationships in LINQ - Using Late Binding

Recently I had a requirement where I needed to get related records via a many-to-many (N:N) relationship in Dynamics 365 via a plugin in C#.  During my searching online, I kept coming to posts that involved using query expressions.  I wanted to do this with LINQ for consistence reasons and readability in my code.  I will also add that what I was doing was being done via Associate and Disassociate messages of the plugin.  I won't be reviewing that part of the plugin in this post, but I will just be focusing on the LINQ statement used to get the related records via the N:N relationship.  Here is the example code that I came up with: public List<Entity> GetRelatedRecords(Guid parentID, IOrganizationService service) { OrganizationServiceContext context = new OrganizationServiceContext(service); List<Entity> oProducts = (from r in context.CreateQuery(RELATIONSHIP_NAME) join eOne in context.CreateQuery(ENTITY_ONE_LO

SCRIBE Software Acquired By TIBCO

On June 6th, 2018 Scribe Software was acquired by TIBCO.  Below is the announcement I and other partners received in an e-mail with links to the press release. "We are pleased to announce that on June 6, Scribe Software was acquired by TIBCO Software. This milestone reflects the increasing strategic importance that Scribe’s product line has with IT organizations and presents great opportunities for Scribe’s partner community. In the short term, there will be no immediate impact to how you conduct business with Scribe. Your sales and support contacts will all remain the same. Over time, we expect that the combination of Scribe’s best-in-class iPaaS with TIBCO’s enterprise product portfolio, which includes messaging, application integration, API management, and analytics offerings, will provide significant capabilities and opportunities for Scribe’s partner community. To learn more about the opportunities that lay ahead, read the  press release ..."

HttpWebRequest For Scribe Online Api

Scribe has made it extremely easy to work with their API.  Currently, in my limited free time, I am working on a reusable C# library to send and receive data from Scribe's API.  Once it is completed for Version 1, I will list it to GitHub, so anyone can consume it and provide feedback on improvements.  There will be a fully built out wiki with how to consume the library with references to the Scribe API documentation.  Also there will be both TDD (Test Driven Development) and BDD (Behavior Driven Development) projects.  This way you can see examples of how to consume the library as well as what I tested before release.  If you are not familiar with BDD, I recommend you check out my blog post in my Dynamics 365 blog , that gives a high level overview of it. Anyways, back to what this post is about.  While working on the library, I came across one small issue around TLS 1.2 and making sure that the web request uses it.  Luckily, this is really easy to set in C#, when using .NET 4.

Test Your Code With Your User Stories - Behavior Driven Development

When we are designing a new system, one of the tools we use is user stories.  User stories allow us to define what the feature should do from the view point of the end user.  This way we take a user centered approach to designing the system.  These are also used as part of our functional testing when writing code (plugin, JavaScript, etc.) to make sure what was written matches the user story.  Even if we use Test Driven Development (TDD) we could easily miss some of the key functions within the feature and need to go back to our code to make changes and then restart our testing process.  This can be time consuming.  Wouldn't it be better to start our testing off with the user story? With advancements in frameworks and technology we now have the capability to write test scripts directly from the user story using SpecFlow .  Taking this approach is known as Behavior Driven Development (BDD) because we are testing the users interactions instead of just data and functions.  This beco

SCRIBE Online April 2018 Update is Here!!!

On April 6th, 2018 Scribe released an update to SCRIBE Online.  You can read all the details of the changes  here .  In this post about the update, I want to go over some of the stuff I have seen while working with this new update, and it's an AMAZING update to the platform.  Here are my highlights: Performance  -  There does appear to be improvement to how well the platform functions in Chrome (Chrome is my primary browser).  Previously, I did have some performance issues in Chrome and on larger map's I would have to dump my cache or exit chrome and re-launch to speed it back up again (not always the case, but did need done from time to rime).  This appears to be eliminated for me.  I can clearly see marked improvements when it comes to lag and performance.  *See bullet point 4 under Platform which is under Enhancements. Agent Request Logs  - Users now have the ability to request the logs from the agent without logging into the server where the agent is installed to get

Getting Started Connector Development

One of the benefits of working with Scribe Online is how easy they make it to create connectors if one does not exist.  In this blog post we are going to look at how to get setup, if this is the first time you have made a connector for Scribe Online.  But, before we get into that, we should first make sure that a connector doesn't already exist that can handle what we need. We can do this by looking in the Scribe Online Marketplace .  Still not seeing what you need?  Reach out to Scribe directly or ask in the Scribe forums if a connector exists for an application.  There are instances where a connector exists but is not listed in the marketplace.  An example of this is for a client that I built a connector for.  They didn't want to setup a system to run the on-premise agent, so they asked me to set up the connector to run on Scribe's cloud agent.  This meant that I had to submit the connector to Scribe for validation.  Once published the connector is in the Scribe marketp

SCRIBE Labs - Variable Connector Used To Control A Loop (Dynamically)

Recently, while working on a data migration task, I had a requirement to transform data stored in a string delimited by ";" and parse it to create multiple line items in the target systems.  Here is an example as a visual: Source: productA, productB, productC, productD... Target: productA ProductB ProductC ProductD ... In the target system, each product would be a line item on an opportunity.  In the source system this was all listed in a text box as a string and delimited by ";".  Also the cell where this data was in the source could be null, have one item, ten items, fifty items, etc.  So I needed a way to loop through this. To set this up I needed to use three connectors, source, target, and Scribe Labs - Variables .  Below is an image of the section of the mapping where I achieved what I needed to happen: If Product To Add - This is the null handler.  If the field where the products are listed in the source is null, then we skip adding any produc

XrmToolBox Bulk Attachment Manager - Version 2018.2.3.2 Released!

I am pleased to announce that this week, I published an update to my XrmToolBox Bulk Attachment Manager plugin.  For those that are not aware my plugin allows a user to download note attachments, email attachments, or both from Dynamics CRM. This update includes bug fixes and a major enhancement that was requested by a user.  The enhancement is the ability to create a report of attachments in the system.  To do this, follow these steps: In Step One, choose if you want a report on notes, emails or both. In Step Two, choose "Report Only". Step Three, click on "Run". You will see the table populate with information.  Once it is done, click on export and you will be provided with a pipe delimited ("|") .csv file with the data in the table.  You can take this to quickly find attachments you are interested in.  With the note GUIDs from the export you can provide them as a filtered down list, so you only export those attachments using the "Specific

XrmToolBox Bulk Attachment Manager - Version 2018.2.2.7 Released!

Today I have published version 2018.2.2.7 of my XrmToolBox plugin.  The purpose of this plugin is to make it easy to download and backup attachments in CRM.  This release is a major release as it is the first built version with all pieces working.  The first version  only had note downloads working. Overview of Plugin: Current Version: 2018.2.2.7 Purpose: Download Attachments and E-Mail attachments GitHub Link . GitHub Wiki Link . Nuget Package Link . How To Use The Tool: Launch XRMToolBox. Connect to organization. Step 1, choose what you want to download. (Once a choice is made, Step 2 becomes usable) Notes - Download attachments from note entity. E-Mail - Download attachments from emails. Both - Downloads attachments from notes and emails entities. Step 2, choose if you want to download all attachments in the system or specific attachments.   All Attachments - This will search the chosen entity to find all records that have an attachment and download the

Validating User Input In CRM Portals With JavaScript

When we are setting up CRM Portals to allow customers to update their information, open cases, fill out an applications, etc. We want to make sure that we are validating their input before it is committed to CRM.  This way we ensure that our data is clean and meaningful to us and the customer. CRM Portals already has a lot validation checks built into it. But, on occasion we need to add our own.  To do this we will use JavaScript to run the validation and also to output a message to the user to tell them there is an issue they need to fix. Before we can do any JavaScript, we need to check and see if we are using JavaScript on an Entity Form or Web Page.  This is because the JavaScript, while similar, will be different.  First, we will go over the JavaScript for Entity Forms.  Then, we will go over the JavaScript for Web Pages.  Finally, we will look at the notification JavaScript. Entity Form: if (window.jQuery) { (function ($) { if (typeof (entityFormClientVali

Using Microsoft Dynamics 365 Within Microsoft Teams

In my SCRIBE Online blog , I wrote about how we can use SCRIBE Online in Microsoft Teams.  In this post I am going to talk about how we can use Microsoft Dynamics 365 in Microsoft Teams.  For those that might not be familiar with Microsoft Teams, it was released by Microsoft in 2017 to help increase communication and productivity within Teams.  The best part about Microsoft Teams is it is 100% FREE.  Click here to download Microsoft Teams .  Since it's release there have be many updates and added connectors, that increase its functionality and usability. To leverage Microsoft Dynamics 365 within Microsoft Teams we can use either the Website Tab or the Dynamics 365 Connector.  First we will start with how to add the Website Tab. In you team, choose the channel you want to add the tab too. Click the "+" in the channel you have chosen and you will get a pop-up Click on "Website" There will be a pop-up asking to input the tab name and URL.  At this point you

Using SCRIBE Online to Migrate Opportunities Into Microsoft Dynamics 365

  Recently while creating map's for a data migration from a legacy system to Microsoft Dynamics 365 using SCRIBE Online, I found that I needed to bring in Opportunities.  Anyone that has worked with CRM for a time, know's that migrating closed opportunities into CRM can be a bit of a pain.  I was having one issue in particular when bring this data in, the actual close date was being set to the day the record was migrated into CRM.  This is because of how CRM handles opportunities when they are closed. Here is what I was doing: I performed all my look ups first to get the associated account and contact from CRM. I created the opportunity with the closed status of won or lost (see links below for website to get the standard values for reference). This makes the opportunity as read only (which I expected to have happen.  But, the actual close date was set for the day the record was created.  Even though I provided a date in the actual close date field. Why is th

Getting Your Data Into Dynamics 365 - Data Migration

When doing an implementation of Dynamics 365, it is rare that a new system is being setup with no data needing to be brought into it.  When looking into how to get that data into the new system, it can be really confusing trying to decide which tool to choose.  In my experience, people tend to choose the tool to use based on price and this should really be the last thing to consider.  That is one of the reasons I will not talk about price in this post.  Instead I will stick to the Pro's and Con's for each tool and provide an overview of the tool and any experience(s) with each. Here are the tools we will be looking at in this post: KingswaySoft SCRIBE Online D365 Data Import Wizard D365 Data Loader KingswaySoft: KingswaySoft is an integration toolkit built on SQL Server Integration Services (SSIS).  It is an on-premise solution (but can be cloud if installed on virtual machine in Microsoft Azure or Amazon AWS).  It can be used for integration, migration and replication

SCRIBE Stream Deck Version 2 Release - v02.01.2017

In a previous post , I talked about using SCRIBE Online with my Stream Deck .  The way I did this was creating a few small programs that I connects to an open button on my Stream Deck.  This was a temporary solution I created as a proof of concept.  What I didn't like about it was that I didn't have all the SCRIBE functions on it and I had to create multiple projects in visual studio.  But, it did prove that what I wanted to do could be done.  Since that post I have rewritten the project into one application that does the following: Allows for user created functions without having to change code. Provides all the SCRIBE functions on the Stream Deck. Provides buttons to launch SCRIBE Online, SCRIBE Forums, and SCRIBE Help. Provides buttons for cut, copy, paste. Here is an overview of the application: The purpose of this application is to allow the Stream Deck to be used with SCRIBE Online. On start this application will end the stock Stream Deck application before st