Wednesday, June 20, 2012

One or more field types are not installed properly




Scenario : Basically while multiple people working on the same server. There are chances that someone has modified something in List / Document library that is not informed to others.


In this case your sharepoint web parts will be failed in Add/Update/Delete operations. saying error "One or more field types are not installed properly".


Or if you go to the List/Document library you will get the same error.


Resolution : Go to List settings and check weather all the column names are same what you are using in code or check any changes appended to the List definition.


Thank you !!!


sharepoint designer login as different user

Here is one more article on sharepoint designer

Scenario : While we are working with sharepoint designer ( workflows, content types etc ) there are scenarios where required to login with diffarent user.

Shareoint has this feature, But lot of people not aware of this.

Solution :

1. Open sharepoint designer form start menu ( cmd -> spdesign )

2. Open a site and login with any of the user

3. Please have a look at Left hand side botton corner of the Designer windows where you will find an ICON with user image.

















4. Click on that, It will lead you to change login name

Thank you.

Specific file or folder name is too long in sharepoint

Here is the issue while we upload files or create folder to sharepoint document library.

Usually get an error saying that "Specific file or folder name is too long".

Reason : Every sharepoint file name has limited number of characters, It will check for this condition before upload file to sharepoint.

Solution : Sharepoint object model has provided a beauty of way to check for the file name validity.

Here is the code :

SPUrlUtility.IsLegalFileName(filename);


It will return weather all the conditions are passed before upload it to sharepoint.

Thank you

powershell change service account password sharepoint

Usually, We set all the sharepoint admin accounts or service account passwords with expiry period.

After that particular period passwords will be expired. At this point of time we need to update the passwords from either Central admin or Powershell.

Here is the powershell code to update password of a sharepoint account .


$version = $host | select version
if ($ver.Version.Major -gt 1)  {$Host.Runspace.ThreadOptions = "ReuseThread"}

# 1. Adding sharepoint snap-in
Add-PsSnapin Microsoft.SharePoint.PowerShell
Set-location $home

# 2. Provide the service account name
$ServiceAccountName = Read-Host 'Service Account'

$managedAccount = Get-SPManagedAccount $ServiceAccountName

# 3. Get and confirm the serice account new password
$password = Read-Host 'Enter Password' -AsSecureString
$passwordConfirmation = Read-Host 'Confirm Password' -AsSecureString

# 4. Command to change the password
Set-SPManagedAccount -Identity $managedAccount -NewPassword $password -ConfirmPassword $passwordConfirmation -SetNewPassword


Happy sharepoint coding

http error 503. The service is unavailable Sharepoint

Issue : Service unavailable

All of a sudden your Central administration is down and showing Service unavailable. Which is very common error while you are working with sharepoint. which looks something like :

















Most possible reason for this : Farm admin password expired or changed.

Resolution :

Go to IIS ( cmd -> inetmgr ) of your Web front end server.

1. click on Application pools

2. Click on Central admin Application pool ( usually it is named as "Sharepoint Central admin v4" )

3. In right corner actions Click on Advanced settings

















4. Find the "Identity" section click on that and set new password.

















5. Finally you will come up with your recovered Central admin.

















NOTE : If you still getting the same issue try run your Configuration wizard in sharepoitn section this will fix the issue or it will log the issue in the 14 hive LOG folder.

Thank you.

Monday, June 18, 2012

powershell get help command with example

For every command in powershell we can get the example sample script using Get-Help prefix.

Below is the script to get the example for Site back up command in Sharepoint :

Get-Help BackUp-SPSite -example

Output will be looks something like :

Dynamically Retrieve a Collection URL from a Timer Job during Deployment

Here is the big issue in Sharepoint. We can deploy all the other solution in the dynamically other than timer job.

Timer job is the one sharepoint items where we cannot deploy it directly with dyncamic URL.

But microsoft has provided a good turn around for this.

Here is the good technical article where we can take dynamic URL by using feature properties from Code behind.

Click here to get the blog..

Happy coding !!!