Skip to main content

Posts

Showing posts from 2012

CSS and Javascript tips

I learned 2 interesting things today. 1. After you apply custom style sheet to your content in SharePoint, it is still not getting applied when you check in browser. The reason for that is the SharePoint overrides your style (css class). To over come this situation, you can declare your styles in css class as !important. This lets SharePoint know that your css class is priority. .mediumText {     font-family: Arial !important;     font-size: 9pt !important; } 2. If you want to execute javascript code after successful ASP.net validation of controls (required field validator etc...) you need to write a small javascript function which calls Page_ClientValidate to fire validation and get its status (successful - true; unsuccessful-false). and here is the button markup... Happy Coding Vighnesh Bendre

SharePoint 2013 (SP 15) - Creating Custom Lists

As I am exploring SharePoint 2013, I found out that there are lot of things that are new and there are lot of thing that are old but presented in a different manner as compared to SharePoint 2010. For example, Site Actions was on the top left corner in SP 2010. But in SP 15 (SharePoint 2013) we dont have ‘Site Actions’ button. But instead we have a settings icon which is placed at top right corner. When you click on the settings icon select Add an App. This will basically allow you to add custom lists, documents libraries etc. Add an App is basically the same as More Options in SharePoint 2010. From now on custom lists & libraries will be called apps. Just like in Apple store or Android store you can develop apps for SharePoint and sell it. You can find more information here: http://officepreview.microsoft.com/en-us/store/apps-for-sharepoint-FX102804987.aspx When you click on Add an App you will be navigated to a different scree which will display different opti

SharePoint 2013 First Look

Finally I have installed Windows Server 2012 Full Server (8400.0.WINMAIN_WIN8RC.120518-1423_X64FRE_SERVER_EN-US-HRC_SSS_X64FRE_EN-US_DV5.ISO). I have installed it on Oracle Virtual Box. In my previous blog I have explained how I was struggling with installing Server 2012 on VMWare first. And then when I was successful in installing it on Virtual Box, I had actually installed server core version of Windows Server 2012.  This time around, I downloaded the full server version of Server 2012. I was able to proceed with installation without any hiccups.  While creating the VM (using virtual box) I had faced some issue with hard disk space allocation. I have explained it in another blog here . Let us start with the new and improved UI of SharePoint 15. This is how the UI looks like. It follows the new metro look. There are lot of new things. And old things put in new place on the screen. The famous Ribbon of SharePoint 2010 still exists and placed in a

Oracle Virtual Box – Increasing Allocated Disk Space

  For working with Windows Server 2012 & SharePoint 2013 this time I choose Oracle Virtual Box. Microsoft has recommended 60GB of harddisk space for running Windows Server 2012 and SharePoint 2013. When creating new virtual machine (VM) the Vbox took 25 GB as the default for hard disk space. It also mentioned that it is dynamic allocation. I guessed that this will increase as and when the VM needs more space.  I was wrong. I created new VM and installed Server 2012 successfully. But when I was installing SharePoint 2013 the istallation did not succeed because of less disk space.  After some googling, I found a command (run from command prompt) to increase disk apace allocated to the VM. Below are the steps for the same. Open command prompt on host system. Navigate to C:\Program Files\Oracle\VirtualBox . Execute below command: VBoxManage modifyhd filename.vdi --resize 61440 Above command will increse the allocated disk space to 60 GB. After ru

Installing Windows Server 2012 for SharePoint 2013

I follow Corey Roth ’s blogs. In his blogs he has given so much information regarding SharePoint 2013 that I got inspired and started my journey of learning SharePoint 2013. My first task was to get SharePoint 2013 installed on my laptop. I have Intel i5 2.4 GHz (2) with 8 gig memory. I am running on Windows 7 Professional 64bit. I already have VMWare (8.0.4 build-744019) installed where I do my development on Windows server 2008 R2 with SharePoint 2010. So my obvious choice was to get SharePoint 2013 image and install it on my already running VMWare Server 2008 R2. I downloaded the 2.1 gig image and tried installing it on my VM. But failed. There were varied reasons for the failure. So I decided to get Windows Server 2012 and create a new VM from it and then install SharePoint 2013 on it. I downloaded the Server 2012 Hyper-V Release Candidate (8400.0.WINMAIN_WIN8RC.120518-1423_X64FRE_SERVERHYPERCORE_EN-US-HRC_SHV_X64FRE_EN-US_DV5.ISO). Then tried to create a fresh new V

Another Reason for 'Group can not be found' error in SharePoint 2010

Recently I was working on an workflow where I was accessing a group from SharePoint 2010 and from there trying to get user's mail ids. I created a group in SharePoint 2010 from UI. Since this group was supposed to hold only users (approvers for workflow), I did not assign any permission to the group. I left all the check boxes unchecked. Next when you try to get the group from code in workflow, you will get error saying 'Group can not be found'. Below is the code I had written in my VS 2010 workflow. SPGroup spgApprovers = workflowProperties.Site.RootWeb.Groups["Some Group"]; After some googling, I found that if you have not assigned any permission to the group, it will not show up in the code. So I went back to the group, deleted it and recreated with reader permission. Hope this will help someone... Happy SharePointing... -Vighnesh Bendre

Validation before Save in New or Edit form

If you want to do validation based on other column in your out of the box New or Edit form, you can do it using JQuery in SharePoint 2010. In the code below I am trying to validate a text column if the value in the status drop down list is ‘In Process’. The function PreSaveAction() gets fired when the user clicks on ‘Save’ button in the New or Edit form. In this function you can create object of the drop down list and text control and check if the text control is empty when the status is ‘In Process’. function PreSaveAction() { var selectedVal = $("select[title='Status']").find('option:selected').text(); if(selectedVal == 'In Process') { var chrgtoNum = $("input[title='SID Number']").val(); if(chrgtoNum == '') { alert('Please enter SID Number.'); return false; } else{return true;} } else {return true;} } You can see my other blog to learn h

Validation or control form from JQuery - Default New and Edit forms

When you create a custom list, you get default edit and new forms with it. So when you are entering data or modifying it SharePoint provides you a form in a popup that enables you to enter or modify data. But then, if you want to add custom features to the new or edit form, you can do so using JQuery. In the below example, based on the valued selected in the dropdown list, I want to enable or disable other control. And I want to add this JQuery code to the New and Edit forms of the custom list. function HideColumn(stat, active) { var activeObj = $("input[title='" + active + "']"); //initially when the user opens the form, we need to check if the user has selected the status that we have written code for… //if selected value is other than Suspend, disable the control var initialVal = $("select[title='"+ stat +"']").find('option:selected').text(); if(initialVal == '

How to find out used storage space by SharePoint list or library

Recently, I encountered a problem where my site's data was growing rapidly. I wanted to find out which list or library is using how much disk space (storage). I found out an easier option to list all the lists/libraries in the site and their corresponding storage space.  You just have to append " _layouts/storman.aspx " at the end of your site address. But when I checked for the first time, the data was not accurate. But then I saw a message at the top of the page which said data displayed may not be up to date. Revisit the site to get more accurate data. So when I revisited the page. I was able to get accurate information.  This might help some one... -Vighnesh Bendre