Thursday 30 April 2015

InfoPath is used to generate data entry forms for both the acquisition of information as well as storage of that information. With the 2010 release, InfoPath can now be used as an alternate way to present SharePoint 2010 content within the web browser, thus enhancing the overall user experience. Using forms with workflows can help manage and enforce business processes throughout an organization.

Here we can see basic steps to create infopath form and publish it.

To create an infopath form, please follow the steps:

Open infopath designer by click on the Windows, Microsoft office , Select the InfoPath Designer.




The InfoPath designer will open and we have the lot of options to create infopath depending on the requirements.

Select the Blank form and click on the "Design Form"




Here we are selecting the blank form to design as per our usage.


 Then add the controls on to the form and write your own rules and publish by click on the file and click on publish.

PS: Please remember that you have installed MS office in your machine.

Click Here to know How to customize the custom list in the infopath

Tuesday 28 April 2015

All we know SharePoint has lists/Libraries. After creating a custom list in SharePoint we have to change settings for the list.Here I am describing the settings page, as we have three types of settings for the list like General settings, Permissions and Management and Communication.

In this article, we will see all the settings available in our lists in SharePoint 2010 site.


Let’s go through them one after the other.
List Name, Description and Navigation
Here you can provide a name, a brief description of the list and a choice to put your list on the quick launch.
Versioning Settings
Enabling the versioning settings helps you to see the history of the list items.
We have options like:
1.     Content Approval - Requires content approval for submitted items: If you choose Yes once you upload an item, it will be viewable in the list once approved.
2.     Item version history - Create a version each time you edit a file in this list: You can enable the versions as you would like in whole numbers or in decimals.
3.     Draft Item SecurityWho should see the draft items in this list? : If the item is not published or is awaiting approval, you can choose from the following options as to who can view it.
Advanced Settings
Advance Settings have plenty of options for us to modify content types.
1.     Content types: If you choose Yes, you can view, modify the content type your list is using.
2.     Item Level Permissions: Specify which items users can read and edit.
3.     Attachments: Specify whether users can attach files to items in this list.
4.     Folders: You can allow users to create folders in your lists.
5.     Search: Specify whether this list should be visible in search results. Users who do not have permission to see these items will not see them in search results, no matter what this setting is.
6.     Offline Client Availability: Specify whether this list should be available for offline clients.
7.     Datasheet: Specify whether the datasheet can be used to bulk edit data on this list
8.     Dialogs: If dialogs are available, specify whether to launch the new, edit, and display forms in a dialog. Selecting "No" will cause these actions to navigate to the full page.
Note: Dialogs may not be available on all forms.
When you open a new or edit or view form, if you want them in a separate dialog option, you can choose Yes.
Validation Settings
Validation Settings are used if you want to provide the user to provide a particular kind of validation on each submission of their documents or items.
Rating Settings
You can enable ratings of the documents or list items in the form of stars and likes.
Audience Targeting Settings
When you enable this option, it will create a new column where you can input the permission level and the content query web part will fetch values from the column and display data accordingly.
Form Settings
These settings are mainly used for configuring InfoPath forms
Delete this list
Here you can find the options to delete the list. Please be cognizant of this option.
Save list as Template
You can save the list as a template which can be used again with the same fields, same content types as well as if you include content, and it can also be added to the template.
Permissions for this list
You can provide permissions to a list if you don’t want to inherit it from the site and provide unique permission to the list.
 Workflow Settings
Here, you can view all the workflows created by UI, SharePoint Designer and other 3rd parties products such as Nintex.
Information Management Policy Settings
By default, lists will have default content type, Item, Folder will be the content type similarly for Custom lists item will be the content type so it can be changed in here in this policy settings.
Enterprise Metadata and Keywords Settings
Here we have two types of settings.
1.     Add Enterprise keywords: Enabling this feature will add a column to the library and the lists where a user can define keywords for their documents and items to be searched.
2.     Metadata Publishing: You can add tags to your items and documents to be used in your profile as social tags.
Generate File Plan Report
If you generate the file plan report, it will generate a report with all the details.
RSS Settings:
It has the features like List RSS, RSS Channel Information, Document Options, Columns, Item limit.
1. List RSS - Allow RSS: Enables or disables RSS for the list.
2. RSS Channel Information
 Truncate Multi-line Text: Determines if the RSS feed only contains the first 256 characters for all Multiple lines of text fields in the list. For lists with large amounts of text stored in “Multiple lines of text” columns, selecting Yes to truncate these fields to 256 characters will improve performance of SharePoint and the RSS reader.
 Title: May be used by RSS readers when displaying the feed to users to show the purpose of the feed.
Description: May be used by RSS readers when displaying the feed to users to convey a longer explanation of the feed’s contents.
Image: URL May be used by RSS readers when displaying the feed.
3. Document Options - Configure Link and Enclosure settings for RSS items.
4. Columns - Determines which list columns have their data included in the feed and in what order.
5. Item limit - Maximum Items: The maximum number of items to include in the feed’s contents of recently changed list items.
Maximum Days: The furthest amount of time back that RSS will go when looking for recently changed list items to include in the feed.
Columns
Then here we have Columns where you can create, add, modify, order or index columns.
Create Column
Columns Ordering

Indexed Columns

Views
Last but the most important, we can create as many views depending upon our requirements.
These are the different views which I will discuss in detail in my next blog.
This article now will be my base in defining all different types of document libraries and lists as the settings will be mostly the same throughout.

Sunday 26 April 2015

Custom list view customize using XSLT:


In custom list we have different types of view to display. But when we have a requirement that to show the items in 3*3 matrix mode. Then how to do it? Here we can achieve this by customize the default available XSLT in the SharePoint designer.

  1. Create a custom list with the different fields (Name, Email Id, and Mobile).
  2. Create a view as “Display View” in my case.
  3. Open SharePoint designer and click on the lists and libraries.
  4. Find out your list and open the view (here Display view)
  5. Change the view from the “Design” tab in the ribbon under the “List view tools” and select the Boxed, no labels design.
  6. Then click on the Customize XSLT option.
  7. Then find out the below line in the code
    • <xsl:when test="$Position mod 2 = 0">ms-alternating</xsl:when>
    • <xsl:when test="$Position mod 2 = 0"
  8. Change the $Position mod 3 = 0 in both the places and save
  9. Now you can see the change like below.
   



Friday 24 April 2015

All we know that every user in the SharePoint will has his/her own user profiles which will sync automatically when the user added to AD in the organization. To get this user properties we can use any approach like by writing the SOM (Serve Object Model), CSOM (Client Object Model) etc.
In this post I am showing how to get this user profile properties by writing a simple SharePoint Designer workflow. Here we are getting this properties into a list and storing by using People picker field.

Follow the steps to achieve this

Create a custom list and create people picker column in the list
Create columns of which properties you want to get from the properties (Here I have created Email, Phone, Country)
Open your site in SharePoint Designer
Click on the workflows tab from the ribbon, select the list workflow.
Select the list (Here I am selecting the list which created in step 1).
Enter the Name for the workflow and some description for the workflow.
From conditions select If any field equals condition and follow the below steps.




Wednesday 22 April 2015

In SharePoint document library we will be storing the documents.But I had a requirement that i have a document library with country field, but as i have to find out the logged in user country by querying the user profile properties of the current logged-in user and i have to show only that country documents to that user.

To achieve this functionality i took help of JavaScript/J Query and Content Editor web part. I have written script and i placed that script inside the library.

Steps to achieve this:

1.Create a document library with the columns(in my case i have created User Name User Country).
2. Upload documents for different countries.
3.Copy paste the below script into a text file and upload into your site (I have stored it in the site assets library).
4.Edit the document library you created in first step
5.Add the content editor web part and in the content link copy paste the URL of the uploaded file(copy the path of the text file which you uploaded into site assets library).
6. And you are done test it with different country users

Find the script

Script:

$(document).ready(function ()
{
var thisUser = $().SPServices.SPGetCurrentUser();
var userLocation;
$().SPServices(
{
    operation: "GetUserProfileByName",
    async: false,
    AccountName: thisUser,
    completefunc: function (xData, Status)
    {
                  userCountry = getUPValue(xData.responseXML, "country");
       var path = "documentlibraryURL?FilterField1=CountryField&FilterValue1="+ userCountry;
       window.location.href=path;
    
       }

    });
});

function getUPValue(x, p) {

    var thisValue = $(x).SPFilterNode("PropertyData").filter(function() {
    return $(this).find("Name").text() == p;
  }).find("Value").text();
  return thisValue;
}                                        
</script>
  

Sunday 19 April 2015

I had a requirement that to show the list in the collapsible manner(Expand/collapse by click on the + sign).I thought to use javascript/jquery, but later on i have decided to do it using SPD and make use of list settings.Here the technique.

To build the ListView in the collapsible manner, Open SharePoint designer and create page                 and place the empty data view web part.
By clicking on the “click here to select data source” select the list and from the right panel just drag and drop fields on the data view.
Now just comment out the headers of the columns as shown below.



Then click on the “Sort&Group” option from the ribbon of designer under the “Options” tab, select the Field from the Available fields and click on Add then select the “Ascending” from the sort properties , in group properties select “Collapse group by default”, click on OK.



Then copy the XSLT between the tags of <XSL></XSL> and save it as a XSLT file and upload into the site.
By adding the list view web part (same list which you used in the dataview) on the page and edit the web part and give this XSLT link and click Ok. Now it appears as desired in collapse and expand manner.

Cheers,

Saturday 18 April 2015

We all know that SharePoint is compatible with IE, some features will not work as expect in all browsers(chrome/Mozilla). I had a requirement from my client that they want to refresh parent page if they close the parent window(Which is working fine in IE  but not in chrome/Mozilla).since they want it in those browsers also i had a work around and finally i achieved it.

<script language ="JavaScript">
       // To refresh in IE
window.onunload = function(e){

     window.opener.document.location.href = 'parent page URL';  
  };
        //To refresh chrome
window.top.onunload = function (e) {
 
    window.opener.document.location.href = 'parent page URL';
};

//To refresh mozilla
$(window).bind('beforeunload', function(){

window.opener.document.location.href = 'parent page URL';
});


var spDate = $(input["DatetimeControlName"]).val(); // date value of the datetime control
var curDate = new Date(); // current date
var first = spDate.split("/"); split the date
var todayDate = (curDate.getDate()+"/"+ (curDate.getMonth()+1) + "/" + curDate.getFullYear()); // format the current date into dd/mm/yyyy format
var second = todayDate.split("/"); split the current date
var DTCdate = new Date(first[2],first[1]-1,first[0]); format the Sharepointdate into (yy,mm,dd)
var curDate = new Date(second[2],second[1]-1,second[0]); format the current date into (yy,mm,dd)
if(DTCdate > curDate){alert("Yes");}
else{alert("No");}