Joining 6th Street Consulting and going to the SharePoint Best Practices Conference

With great enthusiasm, I’d like to announce my new job with 6th Street Consulting as a full time employee. I’ll be leading their SharePoint practice and building upon their existing portfolio of SharePoint projects mainly geared towards the Aerospace/Defense industries and definitely any other work that may come our way. We are located in the Los Angeles area but have worked with clients all throughout the US so please do feel free to contact us if you have any questions about what we do and how we can help you acheive your goals!

On another note, I’ll also be attending the upcoming SharePoint Best Practices Conference in San Diego, February 2-4, 2009 so feel free to ping me if you’d like to meet up or discuss anything!

Henry.Ong@6sc.com | SharePoint Practice Lead
6th Street Consulting
1601 Pacific Coast Highway
Suite 265
Hermosa Beach, CA 90254
(310) 939-9499 Main Office
(310) 388-1401 Fax

Error encrypting or decrypting credentials / SharePoint service account passwords not synched.

Here’s one that threw me for a doozy…

Scenario:

We had a 2 server dev farm (1 MOSS WFE/APP + 1 SQL Server) with the domain controller on the same server as the MOSS WFE server. One day the host OS (Windows Server 2008 ) decided to give us the big bad black Vista version of the BSOD. After a couple of days of not being able to recover from this we decided to just rebuild the machine and WFE since the content databases were securely stored on the SQL Server.

After rebuilding the Domain Controller and re-installing the MOSS WFE/App role on the server again (yeah, I know…but we were in a rush and didn’t have time to setup another WFE server) it worked fine for about a day. Then all hell broke loose with all kinds of password synching and credential store problems.

Some of the symptoms:

  • There was an error encrypting or decrypting credentials. Either a credential update is currently being performed, or you must update the farm account credentials on this server before you can perform this task.
  • SQL database login failed. Additional error information from SQL Server is included below. Login failed for user ‘DEV\mossservice’.
  • stsadm -o updatepassword didn’t fix it
  • stsadm -o upgradefarmcredentials didn’t fix it
  • The app pool account kept reverting back to the previous account after IISResets

  • The Timer Job Service kept reverting back to the previous account after IISResets

  • Can’t retract, upgrade, deploy solutions

The Fix

So after much sweat, I found this post on the SharePoint forums that linked me to this hotfix (KB 957691). The first time I ran the Configuration Wizard after installing the hotfix, it got stuck on the upgrade part, I believe step 8. I then went and checked all things that ran off of a service account, made sure they all were using the correct account and ran the Config Wizard again. And ta-da! Everything magically works again.

Special thanks to Pav Cherny for his timely article in February 2009’s TechNet Magazine entitled Maintaining Security Account Credentials. It was very educational.

Programmatically setting the default value of a SPFieldBoolean field

Here’s something I couldn’t seem to find documented anywhere…

If you’ve programmatically created a new Yes/No field and added it to SharePoint, you don’t want to set the default value like this:

booleanField.DefaultValue = "No";

or

booleanField.DefaultValue = "Yes";

Doing so caused the following error when I was trying to create folders programmatically in the List that was inheriting the Content Type with that field.

Microsoft.SharePoint.SPException: Invalid Yes/No value
A Yes/No field contains invalid data. It should be either 1 or 0. Please check the value and try again.

That made me scratch my head for a while since the property takes a string and the values in the UI when you set it is Yes or No. How you should set that property is:

booleanField.DefaultValue = "0";

or

booleanField.DefaultValue = "1";

SharePoint Event Handlers with Datasheet View Conflict Error

Here’s an issue that nearly brought me to my knees… almost. I was stressing out all weekend wondering why an ItemUpdating event wasn’t running in Datasheet view, even though it ran fine and dandy when used with the editform.aspx. When used with the Datasheet view, either unknown or conflict errors would prevent the user from committing any changes to the SharePoint List.

Scenario Overview: Custom event handler for a SharePoint List with lots of columns. The ItemUpdating logic needs to compare various dates and number fields to determine if the data could be submitted. Basically the raised event was performing data validation for the List Item being updated.

EditForm Scenario: The ItemUpdating event worked without a hitch. I was able to grab and work with all values coming from the property bag. The end result returned nothing unexpected.

public override void ItemUpdating(SPItemEventProperties properties)
{
int deliveryQty = int.Parse(properties.AfterProperties[IFN_UpdatedDeliveryQty].ToString()); 
}

Datasheet Scenario:Running the same code, the ItemUpdating event would cause errors in the Datasheet view and forces the user to discard their changes. So I fired up the debugger and noticed that the second property that I was trying to access returned null values in the Datasheet view even though it returned the valid objects in the EditForm. This was totally perplexing to me and for the longest time I thought that it had something to do with the Datasheet view being asynchronus and losing its context everytime an item was edited.

Then this morning, I had a friend look at the line of code that was returning the null problem: 

int deliveryQty = int.Parse(properties.AfterProperties[IFN_UpdatedDeliveryQty].ToString()); 

He suggested to instead use a different method to retrieve the values:

string deliveryQty = Convert.ToString(properties.AfterProperties[IFN_UpdatedDeliveryQty]);

I then had to update some code to accommodate and convert the strings to the ints that I had originally wanted and everything worked in both the EditForm and Datasheet view! Woohoo!

Lesson Learned: Correct me if I’m wrong, I guess for some reason MSFT didn’t implement the .ToString() method for people that wanted to retrieve information from the properties bag when an ItemUpdating event is fired from the Datasheet view. So the right way to access the AfterProperties would be to use

Convert.ToString(properties.AfterProperties[IFN_UpdatedDeliveryQty]);

instead of

int.Parse(properties.AfterProperties[IFN_UpdatedDeliveryQty].ToString());

Custom edit forms breaking if workflows or custom event receivers/handlers are attached.

This has been documented elsewhere, but just in case you missed it…

Scenario: You have a custom editform.aspx where you made it all snazzy looking and then you decide to add a custom workflow or event handler to the list to handle data validation or business logic. When you try to submit updates you get a nasty error that looks like this:

The data source control failed to execute the update command.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Microsoft.SharePoint.WebPartPages.DataFormWebPartException: The data source control failed to execute the update command.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[DataFormWebPartException: The data source control failed to execute the update command.]

Microsoft.SharePoint.WebPartPages.DataFormWebPart.UpdateCallback(Int32 affectedRecords, Exception ex) +170

System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +4434003

Microsoft.SharePoint.WebPartPages.DataFormWebPart.FlatCommit() +724

Microsoft.SharePoint.WebPartPages.DataFormWebPart.PerformCommit() +92

Microsoft.SharePoint.WebPartPages.DataFormWebPart.HandleOnSave(Object sender, EventArgs e) +61

Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) +1906

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +50

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +39

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +321

Solution: Even though my server had the SP1 and the Infrastructure Update, I was still getting this error. Luckily, there’s a hotfix from March 2008 for this issue – http://support.microsoft.com/kb/949749

Setting the AfterProperties of a DateOnly Field

I was banging my head for a good 4 hours trying to figure this event handler issue out.

Scenario:
Creating an ItemUpdating event receiver that will intercept and disregard an update on a Date Only column/ field type.

Usual Case with Text Fields:

When working with text fields, you would typically do something like this:

this.DiasbleEventFiring();
SPListItem currentItem = properties.ListItem;
string beforeValue = currentItem[fieldDisplayName].ToString();
properties.AfterProperties[internalFieldName] = beforeValue;
this.EnableEventFiring();

Error: If you tried the above with a Date field, you’ll get an error similar to invalid Date/Time value or format.


Not so usual case with Date Fields:

Using a Date Only field, I had to do this:

this.DisableEventFiring();
SPListItem currentItem = properties.ListItem;
DateTime beforeValue = System.Convert.ToDateTime(currentItem.Fields[displayName].GetFieldValueForEdit(currentItem[displayName]));
properties.AfterProperties[internalFieldName] = SPUtility.CreateISO8601DateTimeFromSystemDateTime(beforeValue.AddDays(1)).ToString();
this.EnableEventFiring();

I went through 3 SharePoint Dev books and countless online samples but couldn’t find anything on using the AfterProperties for Date fields so hope this helps you out! Credit goes to clues found in this MSDN SharePoint Forum post.

Troubleshooting: SharePoint Backup Jobs stuck on Search Database/Components

Environment:
Windows Server 2008
1 x MOSS WFE Server
1 x MOSS APP Server
1 x SQL Server

I recently had to troubleshoot an environment where SharePoint backup jobs were becoming stuck on the Search related databases. The backup status would stay on the initializing phase and wouldn’t go past 50% for these databases and eventually the whole backup sequence would terminate or we’d have to terminate it manually. Checking all the event and diagnostic logs didn’t yield any helpful clues except for the generic event ID’s 6398, 7076, and 6482 which seemed totally unrelated at the time.

Upon closer inspection and some more sleuthing it was discovered that the incremental index jobs were scheduled and running during the backup jobs. Apparently, the backup job was getting confused and got tripped up on this fact. So we scheduled the incremental crawls to run outside of the backup window and everything turned out ok!

Good Read: “Finding and Growing Great SharePoint Talent”

I never ever linkback to any other blogs but Arpan Shah recently posted a great piece of commentary that I had to share. It’s about the state of finding and retaining qualified SharePoint professionals which is a great read for anyone that is looking to hire for SharePoint positions.

One consistent question that’s come up from customers, partners and internal Microsoft communities is: “How do we find great SharePoint talent?” I think an equally appropriate question is “How do we keep SharePoint talent?”.

So let’s start with the first question – How to find great SharePoint talent. There is a lot of talent & interest out there, but it’s important to find the right talent. Clearly this question depends on the type of talent you are looking for (eg. developer, IT Professional, architect, designer, analyst), when you need this person (eg. now, in 2 weeks, in 6 months), how long you’re looking to engage this type of person (eg. contractor, full-time, 1-time engagement) and several other factors (eg. remote, on-site).

Here are some tips:

Plan ahead for talent. It’s not always possible, but the more time you have to hire, the better job you’ll do. It’s too often that managers put developers or IT professionals with no experience with SharePoint on the job and say “go for it!”. One of the most frequent situations I’ve seen is an ASP.NET developer who is tasked to and expected to develop a SharePoint solution – no. An ASP.NET background is absolutely an asset, but that does not equate to SharePoint experience. Without good planning and architecture for your SharePoint deployments, you could run into challenges later on. For eg., a piece of code that runs just fine right now, may run into performance issues as the content grows. The SharePoint Best Practices Series is really focused on helping our customers & partners to plan appropriately.

If you need to employ someone now, either hire someone who has SharePoint experience or push back your plan, grow and invest in your talent. It’s better to wait than to go ahead and deploy/develop in haste.

SharePoint Expertise. SharePoint expertise is a function of training & real-world experience. And as I mentioned before, ASP.NET training/experience does not equal to SharePoint training/experience; SQL DB expertise does not equate to SharePoint IT Pro expertise. It’s important to keep in mind that folks with a strong Microsoft background in development or deployment can grow into SharePoint experts – absolutely. I recommend hiring smart dynamic people and investing in them through SharePoint training and certification.

If you are looking to hire someone to get started immediately, don’t rush your hiring decision. You need to make sure you have found good SharePoint talent. There are a lot of professionals that have SharePoint on their resume – take a deeper look. There is a large pool of SharePoint experts that has steadily increased over the last couple years. Things to look for, by no means comprehensive or a guarantee, are: SharePoint certification, real-world examples/experiences, references & background. Do a serious interview loop. Ironically, this especially goes for short-term contractors and partners you are looking to engage for a short amount of time – you are hiring them for the experience they will bring. Long term employees, of course, you need to make sure they have the competencies you are looking for to be successful at your company and that they possess the ability to learn and become a SharePoint expert.

Remote/Onsite. A strong onsite SharePoint presence is something important to have. Whether it’s a development lead or an architect, you need a “quarterback” that is accountable and can make sure the right things get done. This is true not just for SharePoint, but for any software project. If you’re hiring a contractor who’s a SharePoint rockstar developer/consultant/architect make sure that you either 1) have a quarterback onsite that can run the project and be accountable OR 2) the contractor works onsite. If you lack a strong onsite presence and hire a remote contractor, that doesn’t do the job.

Keeping Talent. Investing in your people is a great thing – all managers should do that. It’s important for your business, company & people. Many partners & customers have commented that they are having a tougher time retaining SharePoint talent. I can share with you my personal experiences on this front. I think I have one of the strongest teams. All managers should feel the same way about their team with the right hiring, training & growth opportunities. It’s important for each manager to have regular career discussions with each employee and have a good understanding of where employees stand; have a management retention strategy and a good pulse on team health. What is the career aspiration for your top talent? What is their trajectory in the current role and in other roles in your company? If someone is talented & their career aspirations can be met by your company, work with them on making the necessary adjustments. If someone is talented & their career aspirations cannot be met by your company, work with them and help them find the right opportunity. I know that sounds counter-intuitive, but planning, working with them, and parting with absolutely good intentions is a win/win. What you don’t want happening is your top rockstar knocks on your door and says “good-bye”. I’ve been lucky because everyone who has left the team, I’ve worked with them on that transition. So no surprises. Just like the first point about hiring good talent, plan ahead for keeping talent.

Custom SharePoint Event Handlers not Updating on New Visual Studio Builds

That wasn’t too descriptive was it? Not sure if this has been documented anywhere else but I came across a quirk today while I was trying to create custom Event Handlers for a Document Library.

Environment:
Windows 2003
MOSS 2007
Visual Studio 2008
Visual Studio SharePoint Extension Kit 1.2

Scenario:
Using the EventReceiver SharePoint template in Visual Studio, I started out with the ItemUpdating method and deployed some code a few times and then decided to switch to using the ItemUpdated method instead. For a dozen builds or so after that I couldn’t figure out whether or not my code was working or the ItemUpdated event was even firing. When I switched back to the ItemUpdating method, it worked as expected even with new code. Switched back to ItemUpdated and no good, no events fired even after IIS resets.

Solution:
Finally I decided to remove the event handler manually by doing the following:

– deactivated the feature
– retracted the solution
– deleted the solution
– deleted the dll in the GAC
-IISReset

Then after rebuilding/redploying the solution everything worked just as expected. Woohoo!

So I’m not going to be a Microsoft SharePoint Premier Field Engineer after all…

I got some depressing news last Thursday via an overnight FedEx letter from MSFT. Three days before I was to be shipped out to Redmond to begin a new life, they officially denied my quest and retracted the job offer that was given to me 3 weeks prior. Heck, they even went so far as to denying me any employment offers until July 2015! That’s pretty damn harsh if you ask me…

So “what the hell happened?!” you’re probably wondering…

<insert shameless self-promotion>

Looking for an experienced SharePoint Professional for your next project? Look no further! I’m making myself available to you and your organization anywhere in the world. Looking for any of the following SharePoint related skillsets?

SharePoint Infrastructure Architect
SharePoint Information Architect
SharePoint Administration
SharePoint Business Analyst
SharePoint Demos
SharePoint Disaster Recovery
SharePoint General Consultant
SharePoint Development/ Enhancements
SharePoint Ninja
SharePoint Optimization
SharePoint Proof of Concepts
SharePoint Training (Admin/ Basic Dev /End-user)
SharePoint Troubleshooting
And just about anything else related to SharePoint.

Henry Ong (that’s me) has exceptional soft and technical skills that can put a smile on any hardened CIO or project manager out there!

If you’re interested, contact me now before someone else books me! If I was good enough for Microsoft, why not you right? 🙂

henry [at] henryong.com

</insert>

So back to my story. Apparently some person(s) up in Redmond’s “ethics committee” or something of that nature wasn’t so impressed by a negative mark on my background check. No, I didn’t hurt anyone. No, it wasn’t drug or alcohol related. It was something juvenile I did a few years back and heck, I felt so disgusted with myself afterwards I even voluntarily turned myself into two random cops on the street in an attempt to fix a problem that nobody was even aware of. Needless to say that one attempt to be forthright and honest turned into this lost opportunity with Microsoft.

Moral of the story? CLEAR YOUR BACKGROUND CHECK of anything negative going back at least 7 years if you’re looking to apply for a position @ MSFT. Why didn’t I do that? Well, I did. Except for the law firm I was trying to use lagged their ass off and it’s taking 3 times as long and 500x more expensive as if I had gone through with the expungement process myself.

So again, if you can overlook a once in a lifetime stupid juvenile decision that I made a long time ago and if you’re looking for a SharePoint Professional that can travel to any corner of the earth, provide remote support, or pitch SharePoint to you executive team feel free to contact me anytime @ henry [at] henryong.com.

I am also open to full time positions in either Orange County or the San Francisco Bay Area of California.

Thanks for listening! 🙂

Design a site like this with WordPress.com
Get started