Monday, July 28, 2008

VM Server cannot connect to network after restore from save state

Ok, I know I am a bit off topic here, but we all use VMs, Right?

So let me start by congratulating MS for their Win2k8 64bit Hyper-V server (Amazing!), but for most of us we still use the Virtual Server on Win2k3, right?

Well, after installing the SP1 for the virtual server R2 i started having this problem:

I Saved state of my machine
Restarted the server (host)
Resumed the virtual machine and boom - the virtual server service halt and crashed, and after manually starting it i got an error starting virtual network connection and no more network for that machine...

Here is the error message:
The virtual machine cannot connect virtual network adapter 1 because another virtual machine with the MAC address is already running. This virtual network adapter will be left disconnected.

Only solution I found (worked some times) was to restart the server, start another machine first (dummy one i dont use) stopping it and than i had a 60% chance that the problem was solved for that session.

Now, for my network I have to use Static MAC address for network cards so i cannot change the MAC address on the VMs.

Today I found a new solution for that issue:
I went to the network card where the virtual network is connected, clicked properties, and unchecked the "virtual machine network services".

I clicked OK, waited for things to proccess my change, and than went back in and checked it again.

And what do you know? Things started to work again - no restart... no removing the virtual machine...

Well, hope it helps you guys, I seen a lot of posts on this but none reported a solution like that.

Shai.

Monday, July 21, 2008

How to hide a field in edit or new item form

I get this question a lot...

How can we hide a field from a specific user, or completely from the edit or new form?

Well the hard way (and SharePoint approved) would be to write some .NET code against the SharePoint API and changing the field visibility - I will not go into it now.

Other way - still hard, is to change the field CAML definitions (Xml files) - also for existing fields not recommended at all - I will not go into it now as well.

There is a much easier way, no code envolved, simply by adding a content editor web part to the page with some javascript that will hide the field content form the user.

It is not perfect, sure. It can be fooled, right.
But for those of you that just need it for cosmetic reasons mostly, this is the perfect solution.

I actually covered that in an older post, I just think its title was not clear enough - please follow this link for the complete how-to manual.
http://kwizcom.blogspot.com/2007/08/managing-field-control-visibility-way.html

Thanks, Shai.

Thursday, July 3, 2008

Creating a view for birthday


Well, I struggled with this for an hour or so until I finally found a solution...

Scenario:
our customer has a list of users with a date field with their Birthday.
He wishes to see the upcoming birthdays for users in the upcoming week.

Problem:
The birthdate field holds the actual birthday of the user (i.e. July 24 1980), but he wants to see it as July 24 2008... July 24 2009... and so on.

Well, since we cannot use the [Today] field in calculated column (all tricks wont work - the field won't update!), I have conjured this solution that only asks for a yearly update to the column:

First, we have to create a calculated column that results in the current year birthdate
(from July 24 1980 to July 24 2008)

1 - create a date column to hold real birthday (named: BDay) or type date.
2 - create a calculate column to hold this year's BDay (named: YBDay).
3 - set the output type of the calculated value to "Date and Time"
4 - use this formula to generate its value:
=DATE(2008,MONTH(BDay),DAY(BDay))


Now, the rest is easy:
You create a view and set filter to 2 conditions:
where [this year birthday] >= [Today]
And
where [this year birthday] <= [Today] + 7


Now, you see all birthdays for the upcoming week!

Just remember - next year you will have to update the formula of the calculated field.

Hope this helps you - sure did saved me :)