Dev L300 Training in Stockholm!

Dev L300 Training in Stockholm!

George Doubinski is coming to Stockholm and he is going to be holding a very rare level 300 (= advanced) Dynamics 365 developer training.

George is an MVP and a good friend of mine and one of the bright beacons in the D365 community, co-founder of both http://crmtipoftheday.com/ and http://crm.audio/ . He is an excellent developer who told me that he is always striving to learning something new. Last he said his goal was to learn a new programming language every year. And to top that off, he is a great presentor and teacher as he is a lot of fun to listen to and almost none can match his skills when it comes to coding in Dynamics 365.

We at CRM-Konsulterna were very happy when we were able to convince him to come to Sweden and Stockholm and teach us some of what he knows! He lives in Australia so this doesn’t happen often.

Read more about it here: https://www.eventbrite.co.uk/e/dynamics-365crm-developer-master-class-in-stockholm-with-george-doubinski-tickets-31443903562

Hope to see you there!

Gustaf Westerlund
MVP, Founder and CTO at CRM-konsulterna AB
www.crmkonsulterna.se

Resco javascript development – be careful of variable names

We are all new to stuff sometimes and I am currently quite new to Resco.NET and the JavaScript API it has. There is quite a lot of information and examples on Resco’s site regarding this but you know how it is when you get going, you’re always looking for something that just isn’t there. Today I thought I was missing some vital part of how to parse the data, turned out I was addressing the fields incorrectly, so I thought I’d share it with you in case you ever got into the same spot.

Well, my current Customer likes the Resco mobile client a lot. They like the ability it has for configuration and the fact that it is so configurable and even has API:s allowing us to make custom webpages for them that they can take offline, as Resco does support full offline.

Back to my problem, I was trying to show some data from the account entity on the html-page and as I had previously tried this, I had no problems with the name field. However, when I tried retrieving a field that we had created, let’s call it “Type” I looked in the list of fields in Woodford as I thought this was their view of the fields and hence how I was to address it. The name it showed was the weird REST-endpoint name with Camel-case “crmk_Type“, but I didn’t Think to much about this and used it in my code. The result was that I just got “undefined” as the returned value from the Resco JavaScript Bridge. It took me quite some time and a very helpful support guy at Resco before I opened the form editor in Resco and noticed that the field name set there was the normal name, used in the database/soap webservice, “crmk_type“. Upon noticing this, I tried the lowercase version and it worked like a charm.

My conclusion is hence that the field names that are to be used in the Resco JavaScript bridge are the lowercase field names, not the Camel case versions, despite the fact that these are the once that you see in the Field list in Woodford. Also, make sure the field that you are addressing has been included in the the field list. This might be changed in the future. If so, I hope to be able to write an update on the subject.

Here is a link to the Support page at Resco.NET where you can download the bridge file and also at the far bottom, go to the reference pages for the Bridge. http://www.resco.net/mobilecrm/support.aspx

Gustaf Westerlund
MVP, CEO and owner at CRM-konsulterna AB
www.crmkonsulterna.se

Issues with the new Plugin Registration tool

As you might have noticed there is a new version of the plugin registration tool out with the new version of the SDK 6.1 released in may 2014. It has gotten a nice facelift in the UI and can now be found in the Tools directory.

However, I have had some issues when working with my on-premise org (it worked fine with online). I got the following error when trying to register a step on a plugin assembly.


Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Assembly file name (CRMKonsulterna.Modelon.Plugins.dll) is in invalid format. Only file name is allowed.
Detail: <OrganizationServiceFault xmlns=”
http://schemas.microsoft.com/xrm/2011/Contracts” xmlns:i=”http://www.w3.org/2001/XMLSchema-instance“>
  <ErrorCode>-2147204719</ErrorCode>
  <ErrorDetails xmlns:a=”
http://schemas.datacontract.org/2004/07/System.Collections.Generic” />
  <Message>Assembly file name (CRMKonsulterna.Modelon.Plugins.dll) is in invalid format. Only file name is allowed.</Message>
  <Timestamp>2014-05-30T06:58:51.0596986Z</Timestamp>
  <InnerFault>
    <ErrorCode>-2147204719</ErrorCode>
    <ErrorDetails xmlns:a=”
http://schemas.datacontract.org/2004/07/System.Collections.Generic” />
    <Message>Assembly file name (CRMKonsulterna.Modelon.Plugins.dll) is in invalid format. Only file name is allowed.</Message>
    <Timestamp>2014-05-30T06:58:51.0596986Z</Timestamp>
    <InnerFault i:nil=”true” />
    <TraceText i:nil=”true” />
  </InnerFault>
  <TraceText i:nil=”true” />
</OrganizationServiceFault>

Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Xrm.Sdk.IOrganizationService.Create(Entity entity)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.CreateCore(Entity entity)
   at Microsoft.Crm.Tools.PluginRegistration.RegistrationHelper.RegisterStep(CrmOrganization org, CrmPluginStep step)
   at Microsoft.Crm.Tools.PluginRegistration.StepRegistrationForm.btnRegister_Click(Object sender, EventArgs e)

I’m including it all here for searchability. I have highlighted the message that is the interesting part.

When retrying it in the older version of Plugin Registration tool, it works just fine, as long as I re-register the assemblyfile. If I keep the assembly file and try to register the step in the older version (6.0.0001.0061) I will still get the error, so I did have to unregister the entire assembly and register it all over. This also only seems to show up when registering to disk (I havn’t tried registereing to GAC as I seldom use that).

Also do note that despite right clicking on the assembly-plugin and pressing “Add step” it seems to omit this information in the form for registering the step so make sure that your step is registered on the correct assembly. I got a bit confused and registered quite a few on ActivityFeeds until I noticed this.

For reference, this is for Plugin Registration Tool version 6.1.0.519 and I am testing it on CRM 2013 UR2 Onpremise.

I am also quite sure these bugs will be fixed soon by Microsoft, but it might be a good idea to keep a copy of the older Plugin registration tool just in case.

Gustaf Westerlund
MVP, CEO and owner at CRM-konsulterna AB
www.crmkonsulterna.se

Ease the trouble of developing callouts

Developing callouts is tiresome, you have to do stop the IIS before each compilation, start it up right after and then CRM has to be just-in-time compiled by IIS, each time. As most of you who have done callout development, this is a nag and takes a lot of time. Stunware has released one way of handling this, which is good when doing large scale callouts, but for smaller callout development it has a bit of a overhead.

Microsoft Swedens CRM expert, Jonas Deibe, has written a posting on his blog concerning how to recycle the application pools instead of resetting the IIS, which means that CRM doesn’t have to be compiled just-in-time each time, saving you lots of hair, and time.

So, have a look at his posting: http://blogs.msdn.com/jonasd/archive/2007/03/28/use-build-events-to-recycle-application-pool-instead-of-iisreset.aspx

Gustaf Westerlund
CRM and SharePoint Consultant

Humandata AB
www.humandata.se

What the H*!LL is the bug? – Debugging the right way…

Debugging, tedious right? What the h!*ll is wrong? Well, I’ve been programming for 18 years and I have learnt a very simple but quite effective principle that usually helps you find the error quicker. It is actually quite simple, but I often find myself not following it and wasting time and patience.

When you get a bug, what is the first question you ask yourself? What the H**LL is the problem?!!!! Well, that phrase actually puts the finger on it. You’re asking the wrong question! It is usually quite difficult to know WHAT the problem is when you don’t know WHERE it is. So the first question should be, WHERE the h****ll is the problem? When you know where exactly the bug is in the code, the question to WHAT the h***ll is the problem? Is usually trivial or very simple.

Might seem a bit too obvious? Think about it, and think about it the next time you’re debugging, and I think you might learn to appreciate it.

Gustaf Westerlund
CRM and SharePoint Consultant

Humandata AB
www.humandata.se