Tuesday, November 27, 2012

Unable to publish workflow created in SharePoint Designer.

When publishing the SharePoint designer workflow, you will come across the following error.

This is a time out issue related to the workflow. To resolve this, we need to add the following tag in the web.config of the site, where we are publishing the workflow.



Save the web.config file and then try to publish the workflow.
Now the publishing will go smoothly.

Thursday, October 18, 2012

Fix for “The column name that you entered is already in use or reserved. Choose another name." Error

When you’re creating columns either the Site Columns or the List Columns in SharePoint, suddenly it might show a message stating “The column name that you entered is already in use or reserved. Choose another name.”. 







When this error comes, you normally go to the create new column page and try to add the same content type again. But the added column will not be shown in the column list. To display this column in the content type column list, just run the following script.

javascript:g_FieldName={};alert('Successfully cleared forbidden columns');

Copy the above script and paste it in the browser URL and then press enter. You will get a confirmation message box as shown below.













After clicking OK, when you go again to the content type columns page, the column will become visible.


Tuesday, October 16, 2012

Meta title and Meta description tags in SharePoint Publishing Page properties

This article is regarding how to add the meta title, meta description and the meta keywords in SharePoint publishing page.

If a SharePoint page is associated with the content types such as Meta Title and Meta description, and you will go to the page properties and tried to add the meta title and the meta description and check-in the file and publish. When you view the HTML source of that page in View Source Option, the added meta title and the meta description tags are missing.

To make the meta tags to appear in the page source we have to follow the following steps.

1.Add the following content place holders in the master page of the site.


2. Save the master page and check-in and publish this.
3. Open the default page of the site and check the ids for the content type or the ids for fields defined in the html code of that page.
4. Note the ids for meta title and meta description.
5. Now go to the corresponding layout page and add the following tags in the layout page of the sites to whom all the content pages are getting inherited. Also add the following piece of code just above the Place Holder Main.








Check in the files. 
Now go to the content pages and add the data for meta title and the meta description.

After publishing the file, open the file in browser and check the View Source. The tags will start appear.

CSS Class to prevent the Ligatures in Firefox.

Some times the Mozilla Firefox browser will hide the texts like “ff, fi, fl, ffi, ffl”. Hence the word "Benefits" looks like "Benets".

Hence to prevent this we need to add the following line of css style class in the corresponding .css file of the application. 


-moz-font-feature-settings: "liga=0";
-moz-font-feature-settings: "liga" 0;

Add the above lines of code in the css class and the ligatures will be disabled.

Email Validation using JavaScript & Regular expressions

The Email validation for the 2,3,4 digit suffixes can be implemented using the following regular expression. 


function IsValidEmail(e) {
        var alnum = "a-zA-Z0-9";        
        exp = /^[a-zA-Z0-9._]+[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/;
        emailregexp = new RegExp(exp);

        result = e.match(emailregexp);
        if (result != null) {
            return true;
        }
        else {
                 return false;
        }
    }

Use the above code to validate the email.

Tuesday, September 11, 2012

Remove the URL appearing in SharePoint Search result.

To remove the URL from the SharePoint search result,

-- Checkout the search page.
-- Edit the search page.
-- Click on the drop down of the search result web part and click Edit web part.
-- Click on the Display Properties.
-- To remove the URL, Click on the XSLT editor.
-- Copy the entire content of the editor and take the backup of it.
-- Then search for the tag
class="srch-Metadata1"  and remove the entire tag.
-- Click on OK.
-- Then check-in the search page and publish the page.

The URLs will be removed from the SharePoint search results.

Thursday, September 6, 2012

Libraries in SharePoint ~ Send To -> Email a Link ~ Ignores all attempts to click it

Some times in the SharePoint Lists and Document Libraries, when we try to Email a link or any document, the link does not perform anything. There will not be any error too.

When we try to search the error either in SharePoint Log by setting the Verbose level of logging, and also in the event viewer logs, we will not get any thing. It is neither an error nor a exception.

The main cause for this problem is the Core.js and Init.js files of SharePoint Server.

Both can be found at the following path.
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033
In MOSS 2007 

and 

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033
In case of SharePoint 2010.

The fix for this problem is, we need to get these files from other servers and paste it in our server.
Before replacing the files, we should take the backup of the original files.

This will resolve our issue.

Wednesday, July 11, 2012

Create Page in SharePoint 2010 and Get Error: Page is already Checkout by Domain\username - Manage Checked-Out Files

Using SharePoint 2010, when creating the new page in  page document library, some times we get the error saying that "Error in creating the page: The page xyz.aspx is being checked out by another user".
We get this error because, Some other domain user has created the file already and he forgot to check in. You try to search the file to discard the checkout by the other user. But there won't be any file in the page library. 


Because unless the user who has created the file himself check in the file, the file will not be visible to the other users. So the user get frustrated.


No need to worry:


Solution:  Fortunately, SharePoint has a solution of taking the ownership of the checked out page from the other user.
Please follow the following steps:


1.In the ribbon section of page library, under the Library Tools heading select Library and click "Library Settings".


2. You will be redirected to the Document Library Settings Page. 


3. In this page, Under the heading "Permissions and Management" click on the link "Manage files which have no checked in version". 


4. You will be redirected to a page where you will get all the files created by some other domain users and are not checked in.


5. Now you have to override the checkout for the other user. For this, first select the files for which you want to override the checkout and then click on the link "Take Ownership of Selection" . 


6. It will give you a JavaScript popup to ask the permission. Click OK and you will be redirected to your page library, where the actual files will be listed in checkout state.


7. Now add the content to the page and check in and publish and approve the page.


Thanks It.

Thursday, June 14, 2012

SharePoint 2010 – "HTTP 500 Internal Server Error" while trying to browse to a SharePoint site using Claims-based authentication {Event:8306}

After creating the site collection in SharePoint 2010 using claims based authentication, when we access the site we get the error 

"HTTP 500 Internal Server Error". For the details of this error we need to check the application log in event viewer. 

This error can be solved by the following steps.

1. Go to Start -- Control Panel --; Administrative tools –> Local Security Policy. Local Policies -- User Right Assignments -- select the Impersonate a client after authentication properties
2. Add the Application Pool account for the site which is not working, i.e. the domain\username
3. Go to the application pools in IIS and if the SecurityTokenServiceApplicationPool is stopped then start it.
4. Reboot the server or do a IIS Reset, so the changes can take effect.
5. Browse the site and it should work fine.

SharePoint error-The password supplied with the username was not correct. "Error while creating web application"

Some days back I was creating a SharePoint web application in my local machine. 
I entered all the details of the web application and when I hit the Create button, i got the following error.

"The password supplied with the username <domain\username> was not correct. Verify that it was entered correctly and try again"

This error occurs when we change the password in application pool of IIS and the password will not be updated into the power shell. 

To change the password in power shell we need to run the stsadm tool.

Step1: 
Navigate to the directory "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN" and run the following command. 

Step2:

"stsadm -o updatefarmcredentials -userlogin domain\username 
-password  password".

After running this command a message will be displayed as "Operation completed successfully."

Step3:
After you got this message, do a IIS reset and proceed with the creation of web application. The web application will be created successfully.