Jun.20

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.

Uncategorized

Nov.07

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.

Focus

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

Uncategorized

May.29

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!

 

 

 

 

 

Uncategorized

Jan.10

JavaScript Grid Framework Released

tl;dr: I’ve release a new JavaScript based grid framework that will work with an ASP.Net back end. You can find the code on Github.

Several months ago I wrote a post about JavaScript based grids.  I’ve slowly been acquiring more JavaScript knowledge and have really liked the speed that you get from doing more programming that’s “closer to the metal”. I’ve found that while .Net web forms can be great for productivity, they can be bad for performance if you’re not super careful.

I had a very large, data-heavy, page with 5+ grids on it. I had done things the “typical” web forms way with Microsoft’s AJAX Control Toolkit and Update Panels. Between the additional JavaScript files that the toolkit generates for you (increasing HTTP requests) and the update panels still sending more data than necessary, my app wasn’t performing very well at all.

So when I needed to speed up  the interactions with the grids, my instinct was to turn to a very basic HTML and JavaScript approach. The result was the framework I outlined in this post. I know there are JavaScript frameworks that allow for data binding. However, some environments are really difficult to introduce new technology so sometimes you just have to work with what you have.

I’ve now put the source code up on Github here. I created a simple Visual Studio project with the bare-bones framework. Currently, in order for the project to work, you’d need to wire it up to a data source and make sure your grid configuration matched your data. I’ll look at adding that and a working sample soon.

While the framework works well, I’m not 100% happy with how it’s designed. I have some changes I’d like to make to make it more useful and less cumbersome So if you have a good idea for improving something, please send me a pull request!

Uncategorized