About Jeremy Foltz


Connector for Dynamics Crashing When Trying to Open a Map

I was recently trying to use the Connector for Dynamics, which is a tool provided by Microsoft to provide a way to integration the various Dynamics software products. In my situation, I was trying to integrate Dynamics CRM to Dynamics AX 2012 R3.

After installing the Connector and configuring the AX and CRM adapters, I began trying to activate the maps in the recommended order which is (taken from the Connector setup guide):

  1. Map enumerated values
  2. Map employees and ERP system users
  3. Map unit schedules and unit groups
  4. Map currency information
  5. Map items and products
  6. Map customers and accounts
  7. Map contact information
  8. Map sales orders
  9. Map sales invoices

Steps 1-4 ran successfully. However, when I would try to open (not yet run) the map for step 5, the Windows service that sits behind the Connector client would stop responding and crash which would cause the client to shut down.

I tried every debugging process I could think of.

  • Turning on verbose logging for both the client and the service.
  • Examining the resulting entries in the server’s Event log.
  • Attaching WinDBG to the Windows service process and examining the output when recreating the error.
  • Running Fiddler to see if the crash was the result of an error in the network traffic (i.e. the CRM adapter had a problem).
  • Scouring the internet, blogs and Dynamics forums for AX and CRM
    • I even posted to the CRM and AX community forms, but had no answers or even responses.

At a complete standstill, I had to choice to open a MS Support ticket. The engineer mentioned that the Connector does not support self-referencing relationships on CRM entities. In our CRM instance, a self-referencing 1:N relationship on the Product entity.

After performing some testing, against an OOTB/un-customized CRM organization, I found that this was indeed the problem that was causing the Connector’s Windows Service to crash. Basically, the self-referencing relationship was causing the Connector to become stuck in an infinite loop which, in turn, caused a stack-overflow and the subsequent crash.

The recommended course of action was to remove the relationship and it’s related fields. However, due to circumstances beyond my control, I wasn’t able to do that.

I asked if the Microsoft team responsible for the Connector would consider updating the Connector to support a self-referencing relationship. After all, it’s a supported customization in CRM. The reply was since the Connector is deprecated (no longer supported after CRM 2016; versions 8.0 and 8.1), the requested change wasn’t going to happen. (There is a new integration tool being released for Dynamics 365 (version 8.2)).

In the end, I was able to find a solution on my own. I found the XML files that contained the meta-data defining the CRM entities which had been configured in the Connector for integration between AX and CRM. These XML files are located on the server where the Connector is installed: C:\Program Files (x86)\Microsoft Dynamics\Microsoft Dynamics Adapter\Adapters\Microsoft.Dynamics.Integration.Adapters.Crm2011\ObjectConfig\(yourCRMOrgName).

I had to remove two lines from the “ProductObjectProvider” file: the line referencing the relationship and the line referencing the field related to the relationship. Once the XML file was edited, I was able to open the Items to Products map in the Connector and run it as needed.

While this solution works and allows you to get around the deficiency in the Connector, there are some caveats to the solution.

  • Any time you connect the Connector to a new CRM organization (i.e. deploy the integration to test or production), you’ll have to remember to manually edit the XML file.
  • Any time you reconfigure the CRM adapter within the Connector, you’ll need to edit the XML file again.
Dynamics CRM


Dynamics CRM and IsSOPIntegrationEnabled

There’s a little known and little documented feature of Dynamics CRM that comes in handy when you want to integration CRM with another system such as Dynamics AX or Dynamics GP. When this feature is turned on, it fundamentally changes how the out-of-the-box Order and Invoice entities function in CRM.

I recently experienced this first hand and wanted to document it so that it helps someone else.

This feature is really an integration mode that CRM offers to make it easier to integrate with AX, GP or other systems. The curious thing is that the mode can not be enabled via the CRM GUI. It either has to be set via an SDK app or via a direct update to the database.

In my case, the Dynamics Connector tool had been connected to CRM and a user had been marked as an “Integration User”. This caused a setting called “IsSOPIntegrationEnabled” to be set to true. This setting is on the Organization entity in CRM or the OrganizationBase table in the CRM database. If you’re using CRM Online, then you have no access to the database. The best way to enable or disable this setting is to use an SDK app and change the setting via the API. More on this in a moment.

The reason I stumbled upon this integration mode setting is that I noticed the change in behavior in the Order and Invoice entities. I have a ASP.NET web application that sends data to CRM. Specifically, it creates an Order and then calls CRM to create an Invoiced from that Order. While in a testing cycle, I noticed the following behavior changes:

  1. When using the custom web  application to create an Order, the Order was being create with a Status of “Submitted” instead of “Active” and a Status Reason of “In-Progress” instead of “New”.
    1. The effect of the Order being created with this Status and Status Reason was that CRM rendered the Order as read-only. This caused the message that created the Invoice from the Order to fail because CRM refuses to create an Invoice from a read-only Order.
    2. The web application was not setting a specific Status or Status Reason.
  2. When creating an Order manually on the CRM form, CRM was throwing an invalid Status/Status Reason error message and preventing the Order from being created.
    1. This was odd because CRM was defaulting the Status to “Active” and the Status Reason to “New” as it should but CRM was still throwing the error.
  3. When creating an Invoice from an Order that had a Status of “Active” and a Status Reason of “New” caused the Invoice line items to have no dollar amounts. This caused the Invoice to have a blank total amount. The Invoice shouldn’t ever have a blank value amount.
  4. On the CRM form menu, the “Create Invoice” button was hidden and the “Submit Order” button had taken it’s place. So there was no way to manually create an Invoice for a given Order.

All of these changes were correct in that they were correct behavior for when the integration mode is enabled. The changes actually makes sense if you want an easy way for users to send an Order to the accounting system to have an Invoice created. Users can click the “Submit Order” button that will automate all of that.

However, it was causing my customizations to fail. So I needed to flip the IsSOPIntegrationEnabled setting to false, to make sure that it did indeed actually cause the behavior outlined above.

I used the following code in a .Net console Windows application to check the IsSOPIntegrationEnabled setting and set it to false. This code is using the CRM 2016 SDK. Simply toggling the IsSOPIntegrationEnabled flag will enable or disable the above behavior.



Scribe Insights Error – Message Processor is unresponsive

I’ve been working on a project where I’ve been using the Scribe Insights tool to move data from a SQL Server database to a Dynamics CRM Online instance. I needed to run this integration each week day so I configured the Scribe Console/Server to manage the integration. I have over 20 different “jobs” (*.dts files) so the process takes well over an hour to run. At first the integration ran well with no major errors.

However, the integration began to fail and when I checked, I found that the error was “The job was terminated because the Message Processor is unresponsive.” As is typical with me, I try to find a solution on my own. So I took to the interwebs and found two primary solutions.

The first solution was to adjust a timeout limit stored in Windows registry. The second solution was to adjust a timeout limit in the Scribe Internal database. I tried both of these but it didn’t help.

I finally contacted Scribe directly (you can’t post on their forum unless they grant you an account) and received a better answer. It turns out that the approach outlined above was on the right track but was not complete. So as of June 2016, you’ll need to follow the below instructions.

If you are using Scribe Insights (this doesn’t pertain to Scribe Online), version 7.6.2 or later, you’ll need to adjust or add two settings to the Scribe Internal database.

--Timeout Registry Settings
If exists (Select Top 1 * From [SCRIBEINTERNAL].[SCRIBE].[KSYNC] Where Section = 'EVENTMANAGER' And KeyName = 'SETTINGS.PROCHANGTIMEOUT') 

--Memory Registry Settings
-- For Queue Integration Memory Issues


-- For File, Timed & Query Integration Memory Issues


If you’re using a version of Scribe Insights older than version 7.6.2, you’ll need to edit the Windows registry on the host server.

Registry Locations: 



Creating the registry entries (the value below is just a starting point and may need to be increased):

  • Right-click on the Settings folder, on the shortcut menu, point to New and then click DWORD Value.
  • Name the new value ProcHangTimeout. Right-click on the new value, on the shortcut menu, click Modify.
  • In the Edit DWORD Value dialog box, in the Value data box, type 180. This is the amount of time, in seconds, to wait before terminating the process.
  • In the Base box, choose the Decimal.

Restart the Scribe services for this setting to take effect. This value may need to be increased depending on your environment.


Update: June 2016

I can confirm that after running the Scribe Integration for several days with the settings above, I’ve not had a problem with the Message Processor becoming unresponsive.

Dynamics CRM,Scribe Insights


Shiny Object Syndrome


Raccoon in a bird feeder

Neal Wellons, Created Commons

My family and I were listening to the classic book “Where the Red Fern Grows” on a recent drive. I highly recommend the book – I think I’ve read it twice already. As is true with any good book, each time you read it you think about it in a slightly different way. It is a book about a young boy who worked very hard to buy to redbone coonhound puppies. Once he had them, he had to train them to follow the raccoons scent.

In order to do this, he needed a raccoon hide. The problem is that raccoons are smart, making them difficult to trap using traditional traps. The boy’s grandfather suggested an unorthodox solution to the problem – drill a small hole in a fallen log, place a bit of shiny metal in the hole and then drive nails in at an angle such the nail points are exposed in the hole.

This all sounded very odd to the boy. When he questioned it, his grandfather said that raccoons possessed the curious quality of being obsessed with shiny objects. It didn’t matter what the object was: thimbles, silverware, buttons, etc. When the raccoon would see the shiny bit of metal and reach into the drilled hole to grab it. The problem started when the raccoon would try to withdraw his hand from the hole: the nails prevented it because his balled up fist that was clutching the object was much bigger than when he first put it in. The raccoon was trapped.

But, wait, I can hear you say! All the raccoon had to do was to release the shiny object and he could withdrawal his hand to go free!

The raccoon was so obsessed with the shiny object that it eventually became his undoing.

So, why did you tell that story?

As I was listening to the story I was struck about how much of this behavior could also be seen in we humans. We even have a name for it Shiny Object Syndrome.

Many of us have dreams and maybe have even gone so far as to set goals to achieve those dreams. Most things worth having or achieving in life will take significant effort.

The problem comes when, as we pursue the goal, something catches our attention and ultimately distracts us from the original goal. It’s like the dog that begs you to throw the ball and as soon as you do, he races off after it. But in mid-stride, he sees a squirrel and forgets all about the ball you just threw.

Shiny objects can take many forms. It could be a new hobby, an alert on your phone, a new toy (yes, even for adults), a new interest, a new idea or many other things. There are new things everywhere and at times it may seem like you’re trying to take a drink from a fire hose.


At times it seems really hard to focus. However, if you stop to think about the alternative to focus – shiny object syndrome – and it’s potential to damage your goals and ultimately, your dreams, maybe we should work harder at focusing.

If the raccoon had focused on what was most important, finding the next meal, and had not been distracted by the new shiny object in the hole, he would have never been trapped. No doubt that, because of the obsession over shiny objects, when the raccoon saw the shiny object it completely took over his mind and he forgot all about finding more food.

If we can focus and drive towards what is truly important in our lives, we’ll realize our goals and dreams. But beware of the Shiny Object Syndrome, it can spell death for goals and dreams.

Remember (courtesy of Dave Ramsey): (Focused Intensity / Time) * God = Momentum



Surface Pro 3: Troubleshooting Tip – 2 Button Reset

Surface Pro 3 SetupI’ve had a Surface Pro 3 since late December 2014 and have really enjoyed it. For me it’s the best of both the laptop and tablet works; providing me with both mobility and yet, substantial power to program or even play games. I’d like to share a troubleshooting tip that has helped me with two different situations where I had to call Microsoft’s Surface support.

The first was when I was experiencing wireless network connectivity after the Surface would awake from Sleep mode. It either wouldn’t see wireless connections at all or it wouldn’t connect. The second issue just happened this week. I received a docking station for the Surface as a gift and hooked up an external monitor to it. But yesterday, the Surface stopped recognizing the external monitor completely.

The external monitor is connected via a mini-DisplayPort to HDMI cable via the mini-DisplayPort port on the docking station. But the mini-DisplayPort on the side of the Surface still worked and the monitor was recognized there. On the docking station port, nothing showed up in the graphics settings or even in Device Manager. It appeared as though the mini-DisplayPort on the docking station was completely dead.

I called Surface support (which is really pretty good!) and the tech had me start with a reset called the Two Button Reset. This was the same troubleshooting technique that I used to resolve the issue with wireless network connectivity. It’s very simple: press and hold the Volume Up button at the same time you press the Power button. Continue holding the buttons for 15 seconds or until the screen goes completely black and there is no haptic feedback from the Windows button beside the screen. Once the screen is black, wait for about 10 seconds and power the Surface back up.

This technique worked for me in both issues – I had just forgotten about it the second time around. In doing research, I’ve noticed quite a few forum and blog posts for both issues but hardly any of them mention this reset technique so I thought I would write it up in the hopes it helps someone else.

Oh, and don’t be afraid of calling Microsoft Surface support. They’ve been really great!

Surface Pro 3


Using Javascript to Interact with Microsoft Dynamics CRM 2011

One of the ways you can extend Microsoft Dynamics CRM is to perform CRUD (create, read, update and delete) operations via the REST API or the SOAP API. This allows you to interact with the data within CRM with just HTML and Javascript. I recently had a project where I needed to create dialogs for the user to process records but the out-of-the-box CRM dialogs didn’t fit the bill. I was able to build out simple, light-weight and fast dialogs that allowed the user do what they needed to do.

Below are several examples of retrieving data from CRM, changing the Status (statecode) and Status Reason (statusreason) fields and associating Many-To-Many records. These examples are using the version of the Javascript SDK that relies on jQuery. Microsoft provides a version that does not rely on jQuery if you’re unable to use jQuery.  These examples where for Dynamics CRM 2011 but should point you in the right direction if you’re using CRM 2013 or 2014.

Retrieving Data

The following code allows you to retrieve multiple records from a given entity.

    'var options = "$select=Name',
    function (values) {
        //OnSuccess callback
    function (error) {
        //OnError callback
    function () {
        //Fires once all data pages have been retrieved.

The filter can be tweaked to match how you are trying to retrieve values. For example, the following filter is matching the School ID value, the Student Name ID value, the Degree optionset value and the Status (statecode) value. This filter would just replace ‘var options = “$select=Name’ in the above example. You can test your filter strings by hitting the OData service over a browser and examining the results.

"$filter=pt_School/Id eq (Guid'" + schoolId + "') and pt_StudentName/Id eq (Guid'" + studentId + "') and pt_Degree/Value eq " + degreeValue + " and statecode/Value eq 0"


Creating Records

The process to create a record looks somewhat similar to retrieving records. However, we create a simple Javascript object to contain the field values for the new record and pass that into the createRecord call.

There are a couple things to note here:

  1. Make sure that the names of the object’s properties match the schema names of the fields you’re populated on the entity.
  2. If you’re trying to set the value of an Optionset field, use the numerical value that CRM assigned to the option.
var myNewRecord= {};
historyRecord.name = 'John';
historyRecord.description = 'This is my description';
historyRecord.fieldA = 'Contents for FieldA';
historyRecord.fieldB = 'Contents for FieldB';

    function (record) {
        //OnSuccess Callback
    function (error) {
        //OnError Callback

Updating Records

To update an existing record, you’ll need the GUID value of the record and you’ll need to create a Javascript object just like when you create a new record. However, you only need to add the fields you’re changing to the Javascript object. Make sure that the object’s property names match the schema names of the fields.

var updatedRecord = {};
updatedRecord .FieldA = 'New value for FieldA';
updatedRecord .FieldB = 'New value for FieldB';

    function () {
        //OnSuccess Callback
    function () {
        //OnError Callback

Associating Records

You can also associate records via the REST/OData API.

    function () {
        //OnSuccess Callback
    function (error) {
        //OnError Callback

Changing the Status and Status Reason

It is possible to change the Status (statecode) and Status Reason (statuscode) from Javascript. However, it can’t be done via the Rest/OData API. You have to build a SOAP envelope and submit it to the service at “/XRMServices/2011/Organization.svc/web”.

    1, //Status (statecode)
    206300005, //Status Reason (statuscode)
    function () {
        //OnSuccess Callback

//Building the SOAP envelope
SetStateRequest: function (newStateCode, newStatusCode, entityName, entityId, successCallback) {
var requestMain = ""
requestMain += "";
requestMain += "  ";
requestMain += "    ";
requestMain += "      ";
requestMain += "        ";
requestMain += "          ";
requestMain += "            EntityMoniker";
requestMain += "            ";
//Setting Record Id Guid
requestMain += "              " + entityId + "";
//Setting Entity Name
requestMain += "              " + entityName + "";
requestMain += "              ";
requestMain += "            ";
requestMain += "          ";
requestMain += "          ";
//Setting StateCode (Status)
requestMain += "            State";
requestMain += "            ";
requestMain += "              " + newStateCode + "";
requestMain += "            ";
requestMain += "          ";
requestMain += "          ";
//Setting StatusCode (Status Reason)
requestMain += "            Status";
requestMain += "            ";
requestMain += "              " + newStatusCode + "";
requestMain += "            ";
requestMain += "          ";
requestMain += "        ";
requestMain += "        ";
requestMain += "        SetState";
requestMain += "      ";
requestMain += "    ";
requestMain += "  ";
requestMain += "";
var req = new XMLHttpRequest();
req.open("POST", "http://adm-v-dcrm01/PokagonDev/XRMServices/2011/Organization.svc/web", true)
// Responses will return XML. It isn't possible to return JSON.
req.setRequestHeader("Accept", "application/xml, text/xml, */*");
req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
req.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
//var successCallback = null;
var errorCallback = null;
req.onreadystatechange = function () { SDK.JQuery.SetStateResponse(req, successCallback, errorCallback); };
Dynamics CRM


Remember the Why

I have small children so as a result I hear the question “Why?” many times. It seems to be human nature to want to know why. Why did I get sick? Why did she go there? We are a naturally curious people.

I’ve found it’s good to turn the simple question of “Why?” back on yourself. It’s an excellent tool for self-reflection and motivation.

Do you know why do do the things that you do? What about the way you think and the things you think upon? Why do you have specific life values and goals? Why are you working here rather than there? Why do you choose to live here? I believe it’s a good thing to know the “Why?” in our life.

It’s good to sit down and spend some time thinking about the “Why’s” of our life. Why, you might ask (pun intended, sorry!)? If you know the “Why”, you have a path or direction to follow. The “Why” also, helps you to hold to your values, goals and priorities when the doubts, weariness or opposition set in. Knowing your “Why” will give you backbone to stand for what is right even when it’s the hard thing to do.

Here are some sample questions to ask your self:

  • Why am I doing the work that I do?
  • Why am I involved in my hobbies?
  • Why do I chose to be married to my spouse?
  • Why do I choose to live here and with this life-style?

These aren’t questions to stir up doubt rather it should motivate you to keep working at your profession, hobbies, marriage, etc. However, it will only be a motivating factor if your “Whys” are solid. For example, if you have a deep love and connection with your spouse, then you’ll strive to make that relationship work and last. If you don’t, then your “Why” is not solid and when the difficult times come in that relationship, you won’t be very motivated to press on.

When stressful, difficult, exhusting or unpleasant times come (and they will at some point), you can Remember the Why. If your “Whys” are solid, they will motivate you to press on through those times.

Remember the Why!








Awesome Stuff: Edition 1

I’m starting a series of posts that feature the best content from the interwebs that I’ve recently come across. It will be an occasional series, mostly focused around entrepreneurship and online business.

If you find something you enjoy, send me an email or tweet!

Dan Miller’s podcast from April 11: “Yes, I do have an education”. He challenges some of the assumptions around higher education while not tearing down the idea of education.

In Dan Miller’s podcast, he used this quote from a Dr. Seuss book:

You have brains in your head
You have feet in your shoes
You can steer yourself any direction you choose.
You’re on your own and you know what you know
And you are the one who’ll decide where to go

Taylor Pearson’s post on “What to do when you don’t know what you want?

A list of recommended entrepreneur podcasts spurred by Brennan Dun:

  • http://wireframes.linowski.ca/2014/02/8-awesome-business-entrepreneurial-podcasts/
  • http://www.startupclarity.com/blog/podcasts-for-bootstrappers-and-solopreneurs/

I found this take on the 7 Habits of Highly Effective People but for web professionals:  7 Habits of Success Web Pros.

I saw this great quote about entrepreneurship from Pat Flynn:

Entrepreneurship is living a few years of your life like most people won’t so you can spend the rest of your life like most people can’t.

— Pat Flynn (@PatFlynn) April 8, 2014



Awesome Stuff


Musings on Doing

I’ve been thinking lately about the difference between what you say or know and what you do. Not really in the manner of being two-faced or hypocritical but rather how easy it can be to simply have a knowledge but never accomplish anything significant.

For example, I build software and in my industry change is constant. There is a fear of being left behind as new things come on the scene and are integrated into other’s toolkits. The reaction to that is to find ways to stay current. Often resources such as podcasts or a collection of active blogs can help keep you informed of what’s going on.

The challenge becomes actually learning the new things. It’s very easy to find your self in a situation where you know what the new things are and maybe how they are best used but not really understanding or personally using them. Your knowledge base looks like a shallow river: a mile wide but an inch deep. You’re more of a consumer of knowledge rather that a producer.

When you would have to draw upon that knowledge to produce something, you’ll quickly hit the bottom of your knowledge. You have a measure of knowledge and can communicate that to other people but you are unable to accomplish much or produce much.

There’s an old saying: “Ever learning and never able to come to the knowledge”. That’s the trap that I believe it is easy to fall into. How can we have a net positive output from our learning?

So, the million dollar question is: how do you avoid that trap?

Focus on Output

Set your focus on the output of every thing you do. Ask yourself what will the end result of this activity or effort be? Does it bring me closer to what I want. Will it improve me?


A commonly used phrase is “live intentionally”. I’ve heard that quite a few times but what does it really mean? It means to be thoughtful about how you live your life; making sure that the way you are living your life lines up with what you want. So if you want to learn something or to improve your skills, intentionally set aside time to work on it.


I saved the best for last! With execution the rubber meets the road. The single best way to acquire knowledge is to actually do the thing you want to learn about. So that means in my industry, if you want to learn to build software, you need to build software. Theory has it’s place but theory won’t build software. YOU have to knuckle down and build software.

Is there a difference between what you say or know and do? What’s the output of your efforts? Are you executing and really learning and doing?



High Performers

I subscribed to Chris Lema’s blog a while back. I like that he is able to deliver value in each one of his posts – even though he blogs daily. I while back I had read an article about high performers in business and was reminded of it today.

Here are several articles that I think you should go read.

Chris has blogged frequently in this topic (in addition to WordPress and other business topics). You can check out his posts here. You’ll be glad you did.