Skip to main content

Posts

Showing posts with the label SharePoint

Putting an button on each line item & updating list with calculated column

Recently I was working on a feature which required me to put a button on every item in the SharePoint list's view. The button name was Assign Me . When clicked, it should update the item and put the current logged in user in the Assigned To field. I followed a hybrid approach. calculated column and custom JavaScript . I tried doing everything in calculated column.  Even though calculated columns allow writing code in JavaScript, they still have some limitations. One of the biggest hurdle is to get the ID of the item. Since calculated columns do not allow ID column, you have to be innovative. I figured out that the checkbox column in every line item has id in the tag. This is always the first column in the view (first td in the tr). Following are the steps I followed to achieve the desired result.  Step 1. Create a new calculated column with output as Number.  Step 2. Put the following formula. I use Typescript, hence replace class name with you...

SharePoint People Editor Control Validation

I was recently working on a visual web part in SharePoint 2013. I added a people editor control on the ascx file. And when I tried to enter the user's name and press enter, the text box started behaving like a multiline textbox. It did not validate the user. Even when I searched for the user and selected, the user did not show up in the textbox. The HTML for the control is simple. I have used this in many other projects. I went crazy. There is so much to learn in SharePoint. SharePoint makes you feel humble, rookie :) This is how the people editor behaved... I tried many things. I even tried to implement Client people picker introduced in SharePoint 2013. Then I stumbled upon a blog by Bill Daugherty II. He had explained about some issue he is facing. Which thankfully worked for me too. http://myspexp.com/2011/03/23/using-the-sharepoint-peopleeditor-in-a-gridview/ The solution was to give a script reference to EntityEditor.js file from _layouts. < script t...

Customizing SharePoint search results web part

In some cases the client does not want to display/see out-of-the-box search results. For example the client wants to have a search functionality only on a specific document library or wants to see all the related links by a particular author. In this case it makes sense to display the search results grouped by author. Below we will try to display the search results web part grouped by author. Step 1. In search centre page(where you have placed search box and search results web part), click on ‘Site Actions’ and ‘Edit Page’. Figure 1. Click on ‘Edit Page’. (Since I have already modified the ‘Search Core Results’ web part, you are able to see group by result.) Step 2. For ‘Search Core Results’ web part, click on ‘modify shared web part’ Figure 2. Click on ‘Modify Shared Web Part’ for ‘Search Core esults’. Step 3. Click on ‘XSL Editor…’ button. Copy all the text available. Now open notepad and paste all the content in it. Save the file as ‘SearchAll.xml’. Figure 3. Click on ‘XSL Edit...

A step-by-step guide to Configuring Forms Based Authentication (FBA) in SharePoint 2007

A STEP-BY-STEP GUIDE TO CONFIGURING FORMS AUTHENTICATION IN SHAREPOINT 2007 Following is a checklist for setting up Forms Authentication in SharePoint 2007 1. Setup the membership data store 2. Add a new user to the membership data store 3. Configure SharePoint Central Administration web.config 4. Configure the SharePoint site's web.config 5. Enable Forms authentication on the SharePoint site 6. Authorize the Forms-based user to access the site 7. Login In this article, we will be using the SQL Server membership provider to authenticate users, but you can use any membership provider that you so choose. The steps involved will be about same, but the specifics of those steps may change depending on your provider. I'm also assuming that you've already installed SharePoint and created the SharePoint site on which you're trying to enable forms authentication. STEP 1: SETUP THE MEMBERSHIP DATA STORE Before you can use the SQL Server membership provi...

Sharepoint search customization - Search-as-you-type (SayT), Find-As-You-Type(FAYT)

I was going through some case studies of search customizations in Sharepoint 2007. I stumbled upon something new!! JQuery for search in sharepoint. That is for implementing 'Search-as-you-type' (SayT) or Find-as-you-Type (FAYT) in sharepoint 2007. It looked so simple and prompted me to give it a try right away. This example uses JQuery and sharepoint web service to get the results for what you are typing. All at client side. No server side code needed. And some of the properties are configurable. Which makes it easier even after you deploy this on production. ;) I implemented it right away, below are some of the screenshots. As soon as you type 3 characters (can be configured), the JQuery will bring out all matching results. You can also use the arrow button (or mouse pointer) and choose the right result and hit enter. Steps to implement Now coming back to the steps for implementing it. It is fairly simple, and can be done in a matter of few minutes. 1. C...

SharePoint (MOSS) AssetPicker (AssetURLSelector) customization

Couple of weeks back I was asked to customize the asset picker to suit client's requirements. The requirement was something like this : there is an ASP.net application running on application server, on click of a button, it should open up the assetpicker from MOSS (SharePoint environment). After the user selects a link and clicks on "OK" button in asset picker, the selected URL must be populated in a label. The challenges faced are related to different server farms of hosted applications. asp.net application is on application server and assetpicker is on SharePoint server. Below are the steps followed to achieve the desired result. 1. CALLINGPAGE.ASPX (this is an plain asp.net application page) This page is part of asp.net application which will be hosted in application farm. This page consists of a “Browse” button on click of which the asset picker will be displayed. To achieve the desired result, we have put an iFrame in the HTML code. This iFrame will not be displayed ...