Boy oh boy, talk about a learning curve. It is not rocket science by any means, but learning how the new tools work, and work together, makes for some long self-education sessions.
The biggest issue that I face is just plain not knowing and/or understanding the various messages that get displayed or reported. As a Visual Studio developer on Microsoft Windows, I usually know what to do when Windows or Visual Studio tells me something. With the Mac and MonoDevelop, not so much. Again, change of environment, change of thinking.
So, if you happen to be like me, and want to get started with Monotouch, do these things:
Step 1: Purchase these books:
They are all pretty good and each has something unique to share.
- Learning MonoTouch: A Hands-On Guide to Building iOS Applications with C# and .NET
- Developing C# Apps for iPhone and iPad using MonoTouch: iOS Apps Development for .NET Developers
- Professional iPhone Programming with MonoTouch and .NET/C# (Wrox Programmer to Programmer)
Note: I wrote a review of Professional iPhone Programming in 2010 and need to carve out some time to review the others as well.
Step 2: Review the Tutorials and Documentation
While you're waiting for your books to arrive, you can explore the Monotouch documentation. Xamarin has done a really good job of updating both their documentation and tutorials, which you may find here.
Step 3: Get the Tools
Ok, this may be the first step because without the hardware and software, you can't do any development. I put this as step 3 because it may turn out that you don't like what you see and you choose not to pursue your Monotouch development. If you DO choose to continue, you'll need these things:
A Macintosh
Apple's XCode only runs on a Mac so you'll need one at some point. I needed a new 64-bit laptop so I chose a Macbook Pro and I just run VMWare Fusion to handle virtual machines that I need for my real job.
An alternative may be MacinCloud, which is a cloud-based Macintosh rental service. I've not tried this personally but they have Monotouch pre-loaded so this could be an option.
Note: If you've tried MacinCloud, I'll love to hear about it.
Monotouch
Well, it goes without saying that you'll need Monotouch to do development with Monotouch. However, you don't have to immediately purchase a license. The trial version will allow you to run your code in the simulator which may work for some period of time. A full license is required to actually deploy to a device.
MonoDevelop
MonoDevelop is the Visual Studio-like development for Monotouch. It handles most of the work necessary to talk to the Monotouch compiler, XCode, etc.
Conclusion of Day 1
Well, that's about all there is for Day 1. I'm still working through tutorials and scanning my books myself. I think I'll try to connect Macbook to my wide monitor tonight so that I can see the tutorial on one side of the screen and have the development environment open on the other. Working on a 15-inch screen and swapping back and forth proved ineffective for me personally.
I have been attempting to carve out time in my schedule to work with Xamarin's Monotouch framework for developing applications on the iOS platform – iPhone, iPad, etc. ( I also own a license for Mono for Android but that may be another story altogether. )
Finally, due to the inevitable end-of-year slow-down, the time has arrived and I am going to devote a couple of hours a day for the next three weeks or so learning the new tools and platform.
Over the past few months I have been working on the basic design for several iOS applications. During this process, I have accumulated a list of topics and techniques that I need to learn in order to complete my apps.
As part of my learning process, I thought it would be interesting to document my progress in a series of blog posts and I will attempt to publish one article each day.
Now I can't guarantee that I'll be able to publish one per day, but I will certainly try.
If you're interested, then stay tuned.
When customizing the ribbon of an Entity, it is important to note that the ribbon is part of the Entity itself, not the Application Ribbon.
This means that if you are creating a solution, you only have to include the Entity component, not the Application Ribbon component.
I've updated my Export JavaScript for CRM 2011 to fixe a small bug related to the naming conventions of web resources. This cause the JavaScript not to be exported.
You can download the update from the Free Utilities page:
http://blogs.infinite-x.net/free-utilities
See this post for more detail about the process.
This week I learned, again, the importance of including the SiteMap in a custom solution.
If you do not add the SiteMap to your solution, and you've specified that custom entities be displayed within it, then CRM will not be instructed to modify the SiteMap to when the Solution is imported and your custom entity will not be displayed as you expect.
You can customize the CRM 2011 Ribbon to add additional functionality via buttons, for example.
When you add such a button, you use Web Resources to identify things such as icons and JavaScript functions, like this:
$webresource:new_CloneRecord.js
$webresource:new_CloneRecord32x32
It important to remember that any Web Resources referenced by the Ribbon exist ( added to CRM and published ) before you import your customized Ribbon XML.
If not, then you'll receive an exception and the import will fail.
The exception will probably look something like this:
Exception: FaultException`1
Message: The ribbon item 'MitchMilam.Form.account.MainTab.Save.CloneRecord' is dependent on Web resource id='new_CloneRecord32x322'.
StackTrace:
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.Execute(OrganizationRequest request)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore(OrganizationRequest request)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Execute(OrganizationRequest request)
at VisualRibbonEditor.ServiceWrapper.ExecuteAsync(OrganizationRequest request, Action`1 callback)
at VisualRibbonEditor.Solution.<>c__DisplayClassa.<Save>b__6(Object sender, DoWorkEventArgs e)
I just realized that unlike other number fields, the default minimum value for the currency field type is 0:
While it may not apply to all situations, it is probably that the user may need to enter in a negative number so this value must be replaced, with a relevant negative limit. Otherwise, the user will not be allowed to enter a negative amount.
Dana Martens of Microsoft posted an article on the CRM Team Blog about some tools and techniques that will help you help the support team when you open a support case.
If you submit cases through CustomerSource or PartnerSource, it's worth reading and is something that I try to do whenever I open a case.
I noticed something rather interesting regarding the way CRM 2011 handles the OnChange event for a Two Option ( or bit field in CRM 4.0 terminology ).
Bit fields can be displayed in one of the following styles:
Radio Buttons
Note: This is the default configuration.
Checkbox
List
The OnChange Event
The normal CRM OnChange Event is fired when a person makes a change to a form field then leaves the field ( using either the tab key or the mouse ). The Two Options fields in CRM 2011 seem to function differently, depending on how the field is formatted on the screen:
| Format | OnChange Action |
| Radio Buttons | The OnChange event is fired immediately upon making the radio button selection. |
| Checkbox | The OnChange event is not fired until focus leaves the control. |
| List | The OnChange event is fired immediately upon making the radio button selection. |
Understanding this action is important because sometimes you need to alter the layout of the form ( hiding or showing items ) based on the setting of a Two Option field. AND, you don't want the user to have to leave the field to make that change appear. ( that is a very awkward series of actions for a user ).
That means that in most cases, you want to use either the Radio Button format or the List format for a Two Option field so that you get that immediate feedback to the user.
Dynamics CRM 2011 introduced us to Solutions, which are self-contained packages of components, customize CRM 2011 to add specific features and/or entities.
Like the exported customizations in CRM 4.0, a solution file is a ZIP file, but it can contain a variety of information. Here is a sample of the contents:
Files:
- [Content_Types].xml
- customizations.xml
- solution.xml
Note: The Solution may also contain additional folders containing specific types of files, such as for Workflows, Plugin Assemblies, or Web Resources.
[Content_Types].xml
This contains an XML package describing the files contained within the Solution ZIP file.
Here is an sample of a solution containing:
- Customizations (xml)
- Plugins (dll)
- Workflows (xaml)
<?xml version="1.0" encoding="utf-8"?> <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"> <Default Extension="xml" ContentType="application/octet-stream" /> <Default Extension="xaml" ContentType="application/octet-stream" /> <Default Extension="dll" ContentType="application/octet-stream" /> </Types>
customizations.xml
This is the standard CRM customization file which is exactly like that of CRM 4.0, but with slightly different contents. Anything required to create a CRM Entity, field, or relationship between those objects, will be found in this file.
solution.xml
This file contains information specific to the solution itself and may include the following:
- Solution name and description information
- Publisher information
- Components that make up the solution
- Any missing dependencies that are required to successfully make the components function
Note: If you have ANY missing dependencies, the Solution will NOT be imported, since the probability of it functioning properly without those missing components is low.
When you Export a Solution, you will receive a notification of required components are missing from the Solution. It is at that time, that those components should be added to the Solution to ensure that it can properly be Imported into another system.
Well, that's about it for today. If you have further questions or comments on Solution files, just leave a comment.



