Page 3 of 20

The Superhero is Dead

Without leadership who do we look to for inspiration

As I lie awake in bed I could only reflect on how much our community has change over the last few years. I assume its due to the reaction of our new reality and the economy in general. SalesLogix superheros are falling away. Not so much as leaving the product or community, just becoming invisible and insular. The fact is, to be a ‘hero’ or evangelist in any community takes a great commitment and in real terms dollars, that few are happy to part with.   For the longest time I had looked towards Ryan Farley, Mike Spragg, and Stephen Redmond for inspiration each supporting the community in providing a developer hub, writing the go-to book or the contributions to the forum, that greatly enhanced the skills of those who were seasoned as well as those coming into SalesLogix for the first time. We all came up through the product at the same time and my contribution at the time was the Legacy mobile platform. It was easier when I was promoting a product that I had a relationship with, and the capacity to announce/discuss whatever was happening in the development pipeline as soon as it was though up. The joys of a small company start-up was there was little communication filters so I was quite liberal on the conversation between myself, and the community as a whole.

Business partners I also observe like to keep their staff close to their vest, in as much as any work is done by the company and not individuals. For the most part there is no external promotion of the incredible skill and talent that does exist in our community nor is there any cross pollination.

I am lucky to say I also know some great people inside of Sage that I get to talk to regularly as I work on product for the team and there are several rock stars that I am happy to call friends, but what our community needs to true leadership outside of Sage to provide life and energy and excitement to all the incredible possibilities that the platform brings.

What do you think, is the SalesLogix superhero gone for good. Who do you derive inspiration from?

Extending the Silverlight Custom Control

Earlier today I posted about creating a custom control to Host Silverlight content inside of SalesLogix. The design time experience was less then desirable as the it looked like an unbound stock control. I really wanted it to stand out from the other controls so I decided to look in to how to control the rendered UI in the quick form editor.

The great thing is its pretty easy to do and in a matter of minutes I was able to get a look and feel that was different then the default.

image

As you can see from the image the control does not look anything like the standard bound control and makes it easier to call out on a given smart part.

So how did i do this. Easy override the Draw method and paint the region the way I want. The following is the code I used to pant the area.

public override void Draw(System.Drawing.Graphics graphics, System.Drawing.Rectangle clientRectangle)
       {

           using (SolidBrush backgroundBrush = new SolidBrush(Color.FromArgb(0xFF, 0xFF, 0x99)))
           {
               graphics.FillRectangle(backgroundBrush, clientRectangle);
              
               using (SolidBrush foregroundBrush = new SolidBrush(Color.Black))
               {
                   using (Font labelFont = new Font("Arial", 10))
                   {

                       string caption = "SilverLight [" + XapName + "]";
                       var stringSize = graphics.MeasureString(caption, labelFont);

                       graphics.DrawString(
                           caption,
                           labelFont,
                           foregroundBrush,
                           new Point(
                               clientRectangle.Left + ((int)(clientRectangle.Width – stringSize.Width) / 2),
                               clientRectangle.Top + ((int)(clientRectangle.Height – stringSize.Height) / 2))
                               );
                   }
               }
           }
       }

Hope this helps you create your own controls that are distinctly different.

Lookup Prefilters

A question came up on to how to use PreFilters on a dependency lookup to provide != functionality. No matter what was set as a conditional operator it seemed like it would return the list based on the condition ‘=’. The prefilters will work as long as as the operator was in the validation list. The following operators are allowed in dependency lookups. Note that the names are case sensitive when typing them in.

  • Starting with
  • Contains
  • Equal to
  • Not Equal to
  • Greater than
  • Greater than or Equal
  • Less than
  • Less than or Equal

with that in place the following code will work correctly in a Smart Part load action

dplArea.LookupPreFilters.Clear();

Sage.SalesLogix.HighLevelTypes.LookupPreFilter filter
    = new Sage.SalesLogix.HighLevelTypes.LookupPreFilter("Area", "Area 1");
filter.CondOperator = "Not Equal to";
dplArea.LookupPreFilters.Add(filter);

Building a Custom Control For SalesLogix Web

I believe it is well know my affection for Silverlight and the development experience it provides. The biggest problem with Silverlight in SalesLogix is that whenever you want to host a application you needed to create a custom smartpart and work outside of the box. For some time I have been mentioning to the core dev team at Sage that they should enable a design time experience to allow for easier embedding of a SilverLight control.

So this morning when I got in the office I decided to roll up my sleeves and roll out a host control.

Building the control

1. Create a new .Net Assembly

2. Add References to core SalesLogix assemblies

image

You will find this assemblies in the SalesLogix\Platform folder

3. Create a class that derives from

image

4. Add custom control properties

image

5. Compile and copy the resultant assembly to the Programs\SalesLogix\ folder

6. Register your assembly with the control assembly list

This is nothing more then adding a entry into the QuickFormsConfiguration.xml file. Though I think from an upgrade process or multi-system process this is problematic it does work well. The Help file gives details to the location of the file for different systems. Within my system I navigated to C:\ProgramData\Sage\Platform\Configuration\Application\SalesLogix

7. Create a new Code generation template (velocity)

This was fairly simple to do. I copied an existing template file and renamed to SilverLightHostControl.WebControlRenderingTemplate.vm . Opening the file and deleting the contents to have an empty and ready to copy in the basic Silverlight control rendering code. Once completed adding the code I saved the file. I also copied the file to my control solution so that there was a ready backup provided for me if the system lost the original.

8. Add the control binding into the into the Control list

The final step was to add the control details to the Web.ControlConfiguration.xml file. This file is located in the model and contains the details for the controls that will be available for the smartpart designer.  I added a new WebControlRenderingProvider node. I found it easiest to copy an existing node and replace it with the my control specific details.

image

9. Test

Once all the steps were completed it was time to test the control and ensure that the contents rendered correctly. Starting architect and I located a page to host the Silverlight control. Easily located in the add control menu.

image

image

image

Finally compiling the site and deploying resulted in the following output.

image

 

Final comments

Adding custom controls is an interesting and powerful way of adding new features to your site and can open up functionality that is not quite possible otherwise. The biggest caveat is the number of files that need to be altered to get this to work just right and how that would be managed in a team based project. With the right processes however it can enable some really exciting features.

March to Windows 8

Yesterday Microsoft Gave a demo of the next Windows operating system .. Windows 8 at ‘D9’. During this demo the new immersive  UI was displayed with a look and feel that seemed to be a mash up of several of their consumer products from WP7 to XBOX, to even the Media PC. From what I could glean it look like Microsoft had come up with a good mix of new world and old world design to not only give those who are not power users the simpler touch capabilities while allowing a reversion back to the fuller OS to do our day to day. The fact that you could take the tablet, undock it and it becomes immediately useful as a touch device and when required dock it back again and get full access to your applications for design/development/accounting and any other business process where touch does not seem practical, for me at least is an immediate win.

I could see businesses excited by the concept as well given the magnitude of MS based infrastructure. Now the capability to continue using the Exchange/SharePoint/Office dynamic and mix in Lync and allow the user to become portable merges in the best of both worlds.

I did go through a bit of a panic with regards to how the start page tiles and applications would be developed. Given that its going to be HTML5 and JavaScript. I still have yet to find the Zen with JavaScript and though I can develop in it, still not as thrilled. I suspect by the time that Windows8 does come out I will get over myself and embrace it as a fact of life.

What is funny is to read the posts that are put up on the message boards, and postings after articles where there seems to still be an issue with the duality that will be windows 8. Microsoft has always been about choice and what is (chuckle if you must) a more open development environment then Apple. The fact that we have so many tool choices, languages, IDES from text editors all the way to what I would say is the best development environment out there (Visual Studio). There is a legacy of applications that work on windows, retail, internal business, shareware, OSS and the like that will still work when windows8 comes out. Not allowing this would be the death knell of the OS since it would become a 0 sum game for any organization in choosing their hardware and software stack. Again let me reiterate the number of applications that would have to be updated/converted would be insurmountable. If application had to be completely rewritten and could not run in the commodity hardware why would one choose to say with the product.

I for one being a developer, mostly influenced by the Microsoft stack am grateful that this duality will exist. My customers investments in technology will still pay dividends and they can be assured that their products will continue to work.

I am so excited about the future of the platform now, and see finally that the vision of the Tablet/PC becomes the tool marries the best of both worlds that I signed up immediately to the Build conference in Anaheim in September. I am not going to mark the end of IPad’s, or Android devices. I believe with the total number of consumers that there is lots of space for several choices but I think moving forward especially from an Organizations point of view the decision of hardware/OS got a lot more interesting.

DropDownList–SalesLogix Lookup Issue

It seems that after a lookup that is in DropDownMode is initialized changes to the LookupPrefilters have no effect. The items are cached and a check is done to not reload the list if any items exist in the list. Since the list is cached a new call to LoadItems will not be made.

Luckily with a little reflection magic this can be resolved. The following code is a method that can be called that will clear the items and allow it to be correctly refreshed in case of a change to the LookupPreFilters

image

Have an excellent day

SalesLogix Web Dependency Lookups

I am working on a project where I have to do some considerable customizations around localization. Specifically the product needs to handle 4 different languages from PickLists, Groups, DependencyLookups, and more. Today I was implementing a solution around dependency lookups and could not get the lookup to change based on my language settings. What I was doing was changing the PreFilter properties to point to an extended field on my ACI table. I tried various things with no success. I decided to dig into the controls code and see if there was something that would lead me to a solution.

In the code I got my Ah Ha moment as I could see that some filter state was being stored in the HttpCache however it was never being cleared, nor was there a way on the control to invoke a clear action. Though the control did not expose an invalidate method the solution was quite simple once the issue was discovered.

Simply call

HttpContext.Current.Cache.Remove(dpeLookup.ClientId);

This will clear the filters from the cache and reload them correctly.

Mark

You broke my Flow

I am sure that I missed a holiday here in Canada today. Well at least in Ontario. There is no rhyme or reason unless there is one and I would suppose this holiday would be ‘Park like a Moron’ day. Heading off to work this morning and stopping by a local Tim Horton’s my cat like senses continued to call out total acts of Douchery. Taking 2 parking lanes, backing well into the drive thru, Parking on the lines and other acts of stupidity. I this morning reflect where the skills of common courtesy have gone and why there seems to be a level of entitlement and ignorance out there that is rampant and disheartening. All this lack of consideration broke the smooth flow of service, making the simple process of picking up a coffee unpalatable.

Anything that gets in the way of a smooth process has a negative impact on its users. The more pain the less a user will want to use the system until they get to the point to dismiss it completely. I had come up with a situation where a customer was having problems with stability. The users were faced with constant logging out of the site and my responsibility was to identify and cure the system from the issues. I set up an environment here at our office that contained their DB and the VFS and was able to replicate their issue. After some time I broke down issues to some of the customizations that were written, not that they were written bad but that they did not go far enough to guard the potential of bad data. Data is a great thing as it allows us to run our businesses and make important decisions, however bad data can take us the the worst place very fast.

So I have written a lot of text to say one thing ..

Test any results from method to ensure that a valid value comes back.

Do not do

IAccount account = EntityFactory.GetById<IAccount>(accountId);

return account.AccountName;

Do

string accountName = string.empty;

IAccount account = EntityFactory.GetById<IAccount>(accountId);

if (account != null) accountName = account.AccountName;

return accountName;

And always, .. always test for null.

Mark

Living in a Box

I have been in this business for a long time and one thing that is certain is the amount of change we go through. Each day one of our partners, or technology providers will introduce a new way of doing x,y and z and for the most part of the process I have gone along with the ride. Microsoft has been very guilty of shifting gears on technologies and many times even cornerstone technologies such as Data Access.

I have been to many conferences where I could hear the grumblings of developers crying about another thing they would have to learn, or how they just built something on a stack that has been made obsolete

Just recently we hear of the ‘death’ of Silverlight, a RIA technology and one that I quite like. We are also hearing the day to day tribal chants on how HTML5 is going to take over the world. Honestly I cannot personally see how HTML5 is going to have the massive impact and I still can see how the browser manufactures can fragment their implementations to that they are still somewhat incompatible.

But this post was not supposed to be a rant on the frequency of change, or that change happens but the joys of embracing the change. Most of my day now is spent on our consulting services and I do not get as much practical time just playing with technologies. I do read a lot so I know what is going on, and fortunately I am still quite skilled (if I say so myself) at getting in quickly and being to apply new technologies with little resistance.

I decided to get back into the play time with technologies that aligned themselves to what we do here at BITtelligent, so I have jumped into MVC3 with Razor, Code First Entity Framework, and more and more Silverlight. I have to say I have been excited with the outcome of late, especially with the productivity curve.

I really got excited with EF for several reasons

1. It was really quick to get up and running and coding the repository objects using Linq was a win over my old world SQL methods

2. It fits will with some basic integration needs in the SalesLogix space.

With SLX there are several people that have worked on Linq providers that can work against SData or the Database directly but for quick and running requirements that you do not want to carry the platform tax for EF Code First seems like the ticket.

So being said I am not a fan of the box, no sir I do not like it and I will be trying to keep out of one from now on and spending more time with learning, trying and applying the new stuff.

Don’t make your Web.Config stinky

I have this ongoing quest to figure out the best practices for creating customizations for SalesLogix web client that will not cause downstream pain come the time a new update comes from Sage. At times there are places that you just cannot avoid to get your fingers into but more and more I believe we should avoid altering the web.config file.

I know its quite easy to add extra app settings, or configuration settings there however doing so means the files has to be included in the check list when doing an upgrade.

From a standpoint of reducing the cost of future upgrades I am proposing that any of your component based configurations should use a separate file. Use the same naming convention as ending your settings with *.config to ensure the outside world cannot view it but store it inside of the app_data folder instead of root. I am also thinking that the configuration file should have a naming prefix such as <companyname>_<area>_settings.config this way new items can be provided/shared between business partners without worry of naming collisions.

I know that this deviates from the ease of use of the included .net configuration libraries but in the long run it makes the application more maintainable.

agree?