Loved the movie Sin City, so I thought I would watch the Spirit yesterday night. I really thought that this movie was  a waist of valuable time. Really stupid dialog, really stupid story and it looked as if it was trying to rely on the effects that for me were flat.

On a another note, while developing some smart parts in SalesLogix web there comes a time that the part has to become custom. That is the level of functionality exceeds the capability of the designers and/or the it serves better to work on the control in visual studio (my favorite environment). When the part is generated inside of AA an interface is created that represents the UI. When you convert it to a smart part you are effectively taking it out of the generation process and this interface will never be created. So when the site is deployed, if you do not clean the reference code in your smart part you will get a compile error when the page is accessed.

I also have gotten into the pattern of splitting out the code from the ascx file so that I can work on them as separate items. So when I convert a smartpart to custom (assuming I create it in AA first) I do the following steps.

1. Deploy and load the site into VS

2. Split the smart part to the Markup and Code files (add a new file with the same name smartpart.ascx.cs)

When this happens VS will ask me if I would like to put the code in the App_Code folder. Say no so that the file stays with the markup file.

3. Cleanup the markup (its not pretty in there).

I take a moment to cleanup and property indent the markup. This makes it easier for editing at a later date.

4. Make the coding changes required

I will make the changes required, including any refactoring required to simplify the smart part. I will also determine usage of the functionality inside and decide if some of the code should be promoted to common library

5. Test

Since I am in VS, I do both a build to determine any compile time errors and a run through the the functionality. This ensures that before I add it back to the support files for the portal its working as expect

6. Add as a support file(s)

I always work off a filebased VFS which has an extra benefit. I can basically just copy the changed files into the model in the appropriate directory location. This saves me from going to AA and doing the Add Folder … Add File steps which can take quite a long time.

Make sure to add the markup file (ascx), the code file and if available the App_LocalResource file as well.

7. Remove the smart part from the entity model

Once the support files  have been added, I go to the entity model and locate the smart part that I started with and delete it. This ensures that it does not get deployed instead of my new updated custom smart part.

That’s it for now. Hope the steps help someone.

Mark

Leave a Reply