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

You will find this assemblies in the SalesLogix\Platform folder

3. Create a class that derives from

4. Add custom control properties

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.

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.

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

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

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?

Looking for a ASP.net MVC developer or 2

Hey All,

BITtelligent is Hiring. We are looking for intermediate web developers to join us in our Cambridge, Ontario office.

I ‘’d like to think we are a cool couple of guys to work with and we have some amazing customers. If you feel you have what it takes to develop solutions utilizing Microsoft web technologies (ASP, MVC, JQuery, Silverlight, …) send me an email, set up a time to come and talk and lets see if we can make an impact.

I can be contacted at mark.dykun@bittelligentdev.com or by Phone at 519-620-7153

We are located at

9-1111 Franklin Blvd

Cambridge, On

Its about Damn Time

It took Apple to legitimize touch. Not only proving it could be done on relatively low powered devices, but it could be such a natural way for the user to interact with the computer. I have read articles that Both RIM and Microsoft was amazed that it was possible given ‘their’ experience with the power consumption requirements of devices and we caught completely off guard when Apple did deliver on the promise. I found this point interesting especially given the massive R&D budget that Microsoft has and the incredible work they do (Surface, XBox, Kinect).

Last night I watched the CES keynote where Steve Ballmer went through some of the current innovations (XBOX, Kinect, WP7 ..) and gave us a glimpse of what will be coming in 2011, some as soon as the next few months.

I have to say some of what was shown excited me, not necessarily from the on stage tech, but from the new promises that are being ushered in. Now I am sure that you are saying that there is innovation occurring in iOS and Android platforms and you are right, but from a business point of view Windows and Microsoft technology just fits with our visions here at BITtelligent.

So what did I get excited about in no significant order.

1. AvatarKinect

So much of our interaction is within the space of a phone/screen now. Meetings are dry and we do not get any visual queues to body language. Imagine if you will the capability of this technology used to provide the virtual meetings/round tables/lectures. It displays a new and interesting interaction model that I hope leaks outside of the XBOX 360. Kinect in general is awesome and it looks like MS beat its numbers by a mile with a goal of 5 mil units in 2010 and hitting 8 mil.

2. Surface

I have loved the technology that is surface and have waited till (1) it matures enough and (2) the cost is not so prohibitive that I could just go ahead and assume some development risk. The next generation of Surface seems to up the anti with regards to capabilities and I have seeing some indication that it will be less then Gen1 tech. Here is hoping that MS brings it out to Devs at the right price point.

3. Advanced Touch PCs

I cannot express how much this kind of notebook excites me with possibilities ICONIA

In everything we do in the development business we have context. The ability to dynamically replace the keyboard with a touch surface provides ways of optimizing many of the work processes/development duties we do from day to day. I would love the concept of the virtual keyboard as a driver for a much larger desktop computer as well. I will be picking one of these up since Its just too much cool for me to pass on. Maybe just maybe there is something I can whip up for the next Sage event to show off some of my ideas on the platform.

So here is to 2011, hopefully the year of the natural interface and touch to smack us straight in the face.

BTW, I have no desire for 3D tv’s that this time. They do not represent a good value and honestly for me I have yet to find one 3D movie beyond Avatar that would actually merit such a tech.