The often overlooked Xamarin.forms scale property

Sometimes it is the simplest things that make me happy.  I was digging through some Xamarin.Forms code on Github when I noticed the use of the Scale property on a view and I thought to myself, “Does that do what I think it does?”

Sure enough, it does.  It will change the scale a view (control) to make it larger or smaller.  The default is 1.0, which is normal size.

I was facing a design issue, at least on iOS where I needed to use a Switch but the normal size made it really seem out of place:

image

I needed something a little more subtle.  After applying a Scale of  0.7, I ended up with this:

image

Which seems much more to size, given the circumstances of the control.

This is simulator work only at this point so I will really need to check it out on the real device to make sure that this scaling doesn’t cause usability issues.

Dynamics CRM: The error is not always what you see

One of my customers has had an issue with their CRM system since I upgraded them from Dynamics CRM 4.0 to 2011. Basically the System Settings page will not allow you to make changes.  I got the following JavaScript error:

<ScriptErrorDetails>
  <Message>Object doesn't support property or method 'down'</Message>
  <Line>426</Line>
  <URL>/tools/systemsettings/dialogs/systemsettings.aspx</URL>
  <PageURL>/tools/systemsettings/dialogs/systemsettings.aspx</PageURL>
  <Function>anonymousr:Objectdoesn'tsupportpropertyormethod'down'</Function>
  <FunctionRaw>TypeError: Object doesn't support property or method 'down'</FunctionRaw>
  <CallStack>
   <Function>anonymousr:Objectdoesn'tsupportpropertyormethod'down'</Function>
  </CallStack>
 </ScriptErrorDetails>

 

So this is an error on the CRM page itself and there is not a lot I can do about it.  I just figured it was a bug in the system.

I’ve put up with it because it was not a huge issue for me, and I really didn’t want to spend any quality time working on a support case. I always figured that it was something that would be fixed by an update rollup.

We are in the process of migrating to Dynamics CRM 2015. The issue persists and now I can no longer ignore it. I have to make changes to the system settings. This also means that it is not server-specific, but something about the CRM databases, since that is the only commonality since I have migrated this system from 2011 to 2013 to 2015.

After asking my fellow MVPs if they had ever seen such an error, and not getting confirmation, my friend Gustaf recommended turning on platform tracing to try and capture the error. I thought that was a really strange thing to do since the error was obviously a JavaScript problem.

Or was it???

So I turn on tracing and captured these errors:

  • Duplicate DisplayName found for lcid '9242' – 'Serbian (Latin, Serbia)'.
  • Duplicate DisplayName found for lcid '10266' – 'Serbian (Cyrillic, Serbia)'.

Which have absolutely, nothing, and I repeat, nothing to do with the problem.

But it did led me to this thread:

https://community.dynamics.com/crm/f/117/t/115766.aspx

Which led me to the real problem.  The Email Attachment size setting was incompatible with CRM 201x.

Someone, at some point had set it to 90,120.  It turns out that the maximum value for that field is 32,768.  Which you will see should you try and enter it by hand.  But, since this was an import, it was not checked.  I lowered the value to 32K and that solved the issue.

Recap

So here is a recap of my findings:

  • I was receiving a JavaScript error saving System Settings.
  • A Platform Traced point to duplicate configuration information.
  • Which led me to a Google search which produced an thread on the Dynamics Community site.
  • Which pointed me to the real error.
  • Which I played around with until I found the real problem and answer.

 

Or, as I like to say:

These are not the droids we are looking for. Move along; Move along.

SnapShot! 3.6 for Dynamics CRM released

SnapShot! 3.6 is now available. You can read more about it by visiting the SnapShot! product page.

You may also download a sample of the reports SnapShot! generates here.

 

What’s in this Release?

This release includes the following:

 

New Reports

The following new reports are available:

Entity Maps

Shows the source and target entities used by the Relationship Mapping process.

 

Attribute Maps

Shows the source and target entities and attributes (fields) used by the Relationship Mapping process.

 

Email Server Profiles

Lists information for the Email Servers configured in Dynamics CRM 2013 and 2015.

 

Mailboxes

Lists information for the Mailboxes configured in Dynamics CRM 2013 and 2015.

 

Custom Code Validation

The Dynamics CRM team at Microsoft released the Microsoft Dynamics CRM 2013 Custom Code Validation Tool to allow an organization to scan their JavaScript for issues that would either not work in different browsers or not work in Dynamics CRM 2013. The only drawback is that you could only review the output one web resource at a time.

I have taken the technique used by the Code Validation Tool and created a single report that shows all of the code issues for the entire organization.

 

New Features and Changes

The following features have been added or changed:

 

Automation Testing Matrix

JavaScript form events have been added to the Automation Testing Matrix report.

 

Open Folder Upon Completion

The functionality that would open the main Excel worksheet when the SnapShot! was complete has been replaced by an open folder operation, since the SnapShot! now generates so many different files and folders.

When this option is checked, it will open a Windows Explorer pointing to the folder created for that particular SnapShot! run.

 

New Folder and Report Structure

Due to the sheer amount of data being reported, I thought it was time that I split up the reports into more manageable segments.

Upcoming Free Webinar: Microsoft Dynamics CRM JavaScript Upgrade Strategies

I am holding a free webinar on Wednesday, January 20th via MSDynamicsWorld.Com:

 

Microsoft Dynamics CRM JavaScript Upgrade Strategies

http://msdynamicsworld.com/event/microsoft-dynamics-crm-javascript-upgrade-strategies

As you may know, Microsoft Dynamics CRM 2013 completely removed support for the Dynamics CRM 4.0 JavaScript object model. In fact, you will be unable to upgrade your organization to 2013 should 4.0 JavaScript be found.

In this session, we will be discussing the tools, techniques, and processes that will make your upgrade a success when moving your JavaScript from the Dynamics CRM 4.0 object model to the Dynamics CRM 201x object model.

Recommendation: Aspose Words and Cells

Several of my tools generate Microsoft Excel and Word documents as part of their output and for the longest time, I have used various open-source libraries to provide me with OpenDocumentXML functionality to generate real worksheets and documents, instead of just CSV and plain text files.

The only problem, especially with my SnapShot! documentation utility, was the amount of time it was taking to generate documents. SnapShot! generates a ton of worksheets and documents and I was growing increasing concerned with the generation time.

So I started looking around for alternatives and I kept coming back to a company celled Aspose.  I have been looking at their components for years and they have two products that I needed:

Aspose.Cells, for generating Microsoft Excel files and Aspose.Words for generating Microsoft Word documents.

Full disclosure: They offer a free copy of their component libraries to Microsoft MVPs so I took them up on their offer.

Let me just say that I am extremely impressed with both Cells and Words.  Extremely impressed.

Not only are their components easy to use, but they are blazingly fast.

Working on SnapShot!, I took me about about 1.5 hours to move both my worksheet generation and document generation from the OpenDocumentXML libraries to Cells and Words. And that is including reading their documentation to figure out how to do things like:

  • Automatically generate tables of content
  • Insert figures into a Word document
  • Word headers and footers
  • Turning on filtering on an Excel worksheet
  • Creating a workbook containing multiple worksheets
  • etc.

And did I mention fast?  Oh My Gosh! Fast.

Cells generates Excel worksheets like it is being paid by the row and it’s almost 5:00pm on Friday night.

The combination of Cells and Words sped up the document generation process between 40% and 50%, depending on the data being extracted from Dynamics CRM.

Again, I am very impressed with the quality and speed of this product.  I don’t give out recommendations often, but this is surely one of them.

And don’t forget that Cells and Words are just two components in their library. I can’t wait to get to use some of the others, like Aspose.Diagram, which generates Microsoft Visio diagrams. Think about that as you are creating your own documentation…

Anyway, that’s my recommendation for today.  Take a look if you have time and interest.

Developing applications for multiple versions of Dynamics CRM

As most of you know, I have a several add-on products for Dynamics CRM developers, administrators, and consultants.

They all share common user interface and application frameworks that I developed several years ago.

When I first started writing these tools all I had to worry about was Dynamics CRM 4.0, which was pretty easy. Then Dynamics CRM 2011 shipped, which made things a bit more difficult, but not impossible.

I just had to separate my internal components so that one section worked with CRM 4.0, and the other with CRM 2011.  Once I got the unified connection user interface component working correctly, everything else just fell into place and things were all warm and cozy.

CRM 4.0 and CRM 2011 communicate over very different means so even though you ask for a single set of information from the user, you must appropriately handle the connection specific to the platform on the back-end.  That took a little bit of work to make happen flawlessly every time.

Then Microsoft shipped Dynamics 2013.  Still not a big deal as I could use the CRM 2011 SDK assemblies to communicate without any issue.

Then Microsoft shipped Dynamics 2015 and I started thinking that maybe I need to re-examine my methodology.  And I am quite happy with my solution.

 

Requirements

I need to communicate with Dynamics CRM 2011, 2013, and 2015 while changing the smallest amount of code possible.

I also had to stay with .NET 4.0, since my user interface framework does not support .NET 4.5 and I was not in a position to write the entire UI for a handful of products.

 

Solution

The solution was to upgrade my SDK .NET assemblies to the Dynamics CRM 2013 level. 

That gave me access to all three platforms as long as I kept in mind that I could never ask for something that did not exist on a specific platform. 

Like SLAs or Entitlements from CRM 2011. Since those do not exist until 2013, it would throw an error.

 

Further Thoughts

For some reason, I had never tried connecting to a lower-version environment using the newest SDK assemblies.  Turns out that works just fine. (silly me for never asking the question till a month ago).

If my UI framework was .NET 4.5 compatible, I would have jumped up to the CRM 2015 assemblies because that is what they are written with.

The only side-effect to this is that I am stuck using Visual Studio 2010 because that same UI framework doesn’t work with Visual Studio 2013, my normal environment.

 

Conclusion

This process was quite eye-opening for me and just about as painless as it could be.  The Microsoft SDK team has done a huge amount of really great work that makes our jobs as developers, much less work than it could be, or even once was.

Let me know if you have had similar or even different experiences.

Explorer! v3.5 for Dynamics CRM Released

A new version of Explorer! for Dynamics CRM: My answer to a better understanding of your CRM data, the way the data is presented to users, and how it is stored within your database.

Version 3.5 adds improved compatibility with Dynamics CRM 2013 and 2015.

Visit the product page for more information about how Explorer! for Dynamics CRM can help you manage your Dynamics CRM data.

Dynamics CRM 2013 and 2015 Installation Notes: SSRS

I ran into a couple of things while performing a fresh on-premise installations of Dynamics CRM 2013 and 2015 that I wanted to capture.

 

Service Credentials

Dynamics CRM 2015 does not like it when the SSRS service, SQL Server Reporting Services (MSSQLSERVER), is running under a local user account so I had to change the credentials to that of a domain user.

 

Report Publishing Error

I ran into this issue as well:

Could not publish report 'Neglected Cases' due to the following error:  Error occurred while fetching the report.

Error occurred while fetching the report.

System.Web.Services.Protocols.SoapException: The report server cannot decrypt the symmetric key that is used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. —> Microsoft.ReportingServices.Library.ReportServerDisabledException: The report server cannot decrypt the symmetric key that is used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. —> System.Runtime.InteropServices.COMException: Keyset does not exist (Exception from HRESULT: 0x80090016)

The solution for which I found here.

Extended Color Palette for Xamarin.Forms

Way back in 2006 I write an article, Cascading Style Sheet Color chart, with a link to a site that created a set of colors that matched the Behr Premium paint swatches.

I thought that might be valuable in my Xamarin.Forms work so I converted their work and created an Extended Color Palette structure using those colors.

There are 760 total colors in this palette.

You can find the source on my GitHub Repro:

https://github.com/MitchMilam/PaletteEx

Microsoft Windows Tip of the Day: Copy a Dialog Box Text

I find it very helpful to have a textual copy of error reports found in dialogs such as the one below:

image

 

If you didn’t already know it is actually possible to get the text of a dialog in Microsoft Windows, in any version that I have ever used, up to and including Windows Server 2012.

Just press Ctrl+C and all of the text, buttons included, will be copied to the clipboard.

Open your favorite text editor and just paste the text into a document like you would any other.

I hope that saves you some time.

Sharing information and lessons learned with other developers

Sign up for our new KnowledgeBits service and get news, tips and tricks and more, delivered straight to your inbox.