Raising The Bug Bar

In our quest to find the latest, greatest and bestest methodologies out there to ship great software we often overlook the simplest of implementations to get a project going – The Bug Bar.

As much as I wish this was an actual bar a la Bugs, it’s not.

bugs.jpg

The Bug Bar is a simple tool used to keep your team’s head above water when shipping copious amounts of software against an unpredictable schedule.

How it Works

Before each iteration set a maximum number of bugs that can be reported that cannot be triaged into a subsequent iteration based on their priority and severity to the project.

There is no discerning between bugs raised by Developers, QA, End Users or your mother – they are all created and treated as equal.

When that number is hit during the iteration, all feature and task development work is halted until the bar drops down to an acceptable level to then return to feature and task development.

What it Does

Ensures the team is focused on not rushing task and feature development by introducing bugs in the software that were previously not there but aren’t being worked on in the current iteration.

Ensures that the entire team (for business to project to development) are on the same page with this level of importance and know how to react accordingly when this happens.

Ensures your Project Manager is monitoring the bug lists and actively triaging what does and doesn’t apply (taking this load off of Developers).

Sets the expectation that the content is greater than the date.

It’s not a complicated concept, it’s downright simple, but sometimes that is where you need to start to see a change in the delivery of your software.

Disabling Quick Create

I ran into an issue the other day where I needed to turn off the usage of Quick Create forms and ensure that the standard forms would always be used for form creation.

The option to do this per entity is relatively simple – Navigate to your entity (via the solution) and uncheck the following entry.

ActivityPointerFail

Not a problem to do per entity, but it would be nice if there was a bulk, non-coding writing way to disable this functionality across all of your entities.  This is a good example of where these features can then be implemented across the board ensuring a consistent user experience.

Failed to Import Solution Error

I encountered a rather odd error the other day when I was having to do schema changes between organizations that involved a lot of importing and exporting when at one point I could not import the solution into one of my target orgs anymore.

After some digging through the Dynamics logs, the problem became very clear.

I had a field that had been incorrectly typed, so in my source org, I deleted it and recreated it.  When I proceeded to import the solution updates into my target org I could not perform the import because the field already existed but in an incompatible field type.

Specifically, doing some searching through very verbose CRM log file yielded the following entry.

Attribute new_legacyid is a Integer, but a String type was specified.

To get around this issue, I removed and deleted the field new_legacyid from my target org and then performed the import again, which then went smoothly from there.

 

Updating the State of a Record in Dynamics

Had some head banging to do this past week when I wanted to update the state of a record in Dynamics.  For some reason, this has always been an indirect path to accomplishing a simple task.

This article applies only to Dynamics 2015/2016 and below.  In Dynamics365, this method is being deprecated in place of the Update method (YES)!

Before you code anything, there are two references you are going to need in order to access the correct object.

Microsoft.Crm.Sdk.Proxy

Microsoft.Xrm.Sdk

Now that you have those two references you can now leverage the SetStateRequest message to submit your state change (after your entity was created).

 SetStateRequest request = new SetStateRequest();
 request.EntityMoniker = new EntityReference("your_entity_name", EntityId);
 request.State = new OptionSetValue(1);
 request.Status = new OptionSetValue(2);
 
 svc.Execute(request);

In the above, EntityId is the primary id (guid) of the record that was created.  The 1 and 2 are values represent the statecode and statusreasons fields in your system, while statecode will generally be the same (Active = 0, InActive = 1), statusreason can be wildly different.

An informative list of status codes are available here.

Creating a custom Tab in VSTO

If you haven’t used VSTO, it’s the framework for developing Office Integrations.  Yes, people are still developing Office plugins, although Flow is coming on strong, there is still a need for organizations to have components directly embedded in their primary applications of choice.

If you’re looking to get started on building your own Tab in Office you can do this very easily by adding a Ribbon.xml file to your VSTO project with the following syntax.

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
 <ribbon>
 <tabs>
 <!--<tab idMso="TabMail">-->
 <tab id="tabForgotten" label="Coder">
 <group id="MyGroup" label="Content">
 <button id="btnGo" label="Connect" 
 screentip="Go" onAction="OnConnectClicked"
 supertip="Go to start."/>
 </group>
 </tab>
 </tabs>
 </ribbon>
</customUI>

Once you’ve added that snippet, simply navigate back to your main AddIn.cs file and instantiate your ribbon.

protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
return new SuperRibbon();
}

Compile and run (in this example, I created an Outlook VSTO plugin) and you can now see your new menu item.

Capture

Connecting the events are even easier as a complimentary .cs file is created where you can easily wire up this event.

public void OnConnectClicked(Office.IRibbonControl control)
{

System.Diagnostics.Debug.WriteLine("HERE");
}

Lastly, you’ll notice that in my XML tab declaration there is a value that is commented out called TabMail.  All built-in Tabs have their own tabs that you can piggy back off to include your controls therein instead of creating your own tab as was done previously.  All that needs to change is that value.

What it is

Over the past few years, I’ve found myself drifting further from code and not developing as much as I’d really like to be.

Over the past few months I’ve been experimenting with LinkedIn as a blogging platform for technical articles and it really hasn’t felt it like it quite cuts it.  Coupled with this, I used to blog about anything technical that I was doing – Powershell, Lync, C#, SQL, etc – but then started to break it out by technology for better readability.  But that always left me with more to say and nowhere to say it.

So, I’m going back to a single technical blog, about everything and anything as I jump into everything going on around me.  In the coming months, I’m probably going to be focussing more on the Dynamics and SqlAzure fronts as that is where I’m spending a great deal of my time, but I have some branching ideas into other areas of tech that I think I’ll just keep sharing.

Have I forgotten everything?  Let’s see.