It was just working …. What the hell

This is going to be short post on BlackBerry mobile development, specifically SalesLogix Mobile BlackBerry development. A current customer requirement called for the need of a multi-select pick list control. This control would allow the selection of 0,1 or many values from a pre-determined list. The stock pick list control provided in the platform does not support very rich scenarios like this so I was forced to create my own control. Its not that big of a deal, create a derived field control add a layout manager and host the controls you want to display. I have made good headway this weekend on the control with it generally working the way I expected until I decided to add the initial setting  of the selected items code. For this code we take the comma separated list of values and split it into each of the selected items, when finding a match, check that item as selected. So happily I wrote the code in eclipse and then moved it over to Sage Mobile Application Architect.  (I like and use eclipse for heavy java code development tasks). So when I compiled and deployed the client system I was quite surprised that I could not start the mobile application at all. There was no error, no visible indication that I had royally messed up, or that the customizations did not take. Nothing. So I went back to the code that I wrote and started to systematically comment/uncomment until i could find why the client was not starting up. Finally I hit pay-dirt and to my surprise the following line was causing the application to not start;

String[] values = selectedValues.Split(“,”);

What? I mean string splitting, it has to be there. Its such a basic function and eclipse tell me it exists through the dot prompt functionality. Digging into the BlackBerry API documentation it seems that this method really does not exist. Bah. So of course I roll my own custom split method and it works as expected.

Lesson: If the application will not start at all look at your customized code and ensure that you are not using some java API that is not supported on the mobile platform

SalesLogix 7.5.2

Now that SalesLogix 7.5.2 has officially released I wanted to revisit my decision to avoid ‘Code Snippet Actions’. I have been traditionally been using the Code snippets (Obsolete) actions in the past due to issues that I was having with the new form interface based actions. So for the last little while on several of the projects I have been working a specifically decided to to write all my UI event handlers using the form based actions. I have to say that I am very pleased in the stability that 7.5.2 introduced. It is a great step in the right direction. For the simplest UI based customizations it seems like a practical choice and it will be within my recommendations moving forward.

Now, even though it looks as if the code issues of working with Code Snippet actions have been resolved there is still a way to go until it is a very efficient way to develop advanced UI functionality. I want to cite several items that still need to be addressed.

1. Views that are generated and then translated into custom smart parts will fail to work. A form based interface is generated based on all of the designer forms in AA. Once a form is unbound from AA (made custom and moved into support files) the interface is no longer generated and your snippet methods will fail.

2. Accessing any non-interface defined properties or methods means casting to a specific control type. This kind of code is much easier to resolve in Visual Studio.

3. Common classes, shared methods are not first class citizens. If you want to create utility methods that are shared for all of your rules (UI/Business) you either have to create an external assembly and reference it or create an empty handler and add code after the closing } for the class definition that will be globally visible.

4. Though the platform is now based on 3.5 framework the CodeSnippets are defined as a 2.0 project so it may only be possible to have some of the new .net 3.5 goodness in a external assembly at this time. (I want to confirm this and see if there is a code gen script that can be updated)

One of the targets for 7.5.2 was increased performance. In this regard I have to say I am very happy, all around it seems snappier and more responsive.

It really looks as if this release is definitely moving the platform forward.