Posts in: August, 2017

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,

Read More


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

Read More


UCMA – I’m Writing a Message

I was working on a UCMA (Unified Communications Managed API) issue the other day and wanted to integrate the “Is Writing a message” functionality that is oh so important in any chat conversation today.  My application is pretty simple, a chat bot is listening to incoming requests and directing them to their intended recipient.

You can see this in some of the built in examples, but if you haven’t looked there yet, this functionality is quite easy to implement.

In your MessageReceived event from your Message Flow, simply add the following line into the event before you send back your reply and this will trigger an event to fire when this occurs.

MessageFlow.LocalComposingState = ComposingState.Composing;

And that’s it, now you can know when the receiving user start to type a response,

Read More


Dynamics Workflow Scope

I ran into a scenario this week, where  workflow I created was only running for my user account on records that I had created and not ones that I might later modify and/or that other people had created.

The solution was to change the scope of the workflow to Organization so it ran for everyone.

Changing from User (the default) to Organization got this going.  I haven’t had a need to try with the current user’s business unit which would be pretty cool too.

org

Read More


Alternate Keys in Dynamics

In CRM 2015 Update 1, a new concept for allowing a field to be listed as a primary key outside of the traditional Guids was introduced called Alternate Keys.  I had not had a chance to use this feature in-depth so thought this would be a great opportunity to dig into it.

The concept itself is pretty simple – you are integrating Dynamics with another system that has it’s own setup of Primary Keys why not replicate those Ids in Dynamics.  If you are deploying a greenfield solution with no integrations to other systems, you’ll probably never use this feature.  However, if you have a complex synchronization solution between many line of business solutions where an entity in Dynamics could actually represent 5 disparate resources throughout the rest of your organization,

Read More