Thursday 27 August 2015

As SharePoint developers, we can get the chance to write the workflows for the business needs. As we have lot of options to deal with workflows. We also have the option to write these workflows using SharePoint designer (SPD). So let’s have a look what are the available options (Actions, conditions, etc.).

The following features are available in the SharePoint 2010 Workflow platform:
·         Actions:
o    Stop Workflow
o    Capture a Version of the Document Set
o    Send Document Set to Repository
o    Set Content Approval Status for the Document Set
o    Start Document Set Approval Process
o    Declare Record
o    Set Content Approval Status
o    Undeclare Record
o    Add List Item
o    Inherit List Item Parent Permissions
o    Remove List Item Permissions
o    Replace List Item Permissions
o    Lookup Manager of a User
o    Assign a Form to a Group
o    Assign a To-Do Item
o    Collect Data from a User
o    Start Approval Process
o    Start Custom Task Process
o    Start Feedback Process
o    Copy List Item
·         Conditions:
o    If current item field equals value
o    Check list item permission levels
o    Check list item permissions
·         Steps:
o    Impersonation Step


By using these available features we can full fill the business needs and develop the workflows. We will look into some details description about these features later some time.

Monday 22 June 2015

As we are all SharePoint developers , we might get the requirement to get the user country who logged in to the site. We all know that SharePoint having the user profile data in AD. It has properties of the user like name, country,email, etc.,

Here i am posting now that how we can query the User Profile of the SharePoint to get the Country name of the logged-in user.

Refer the below Code:

This is the ready function where we call out function while page load:

jquery(document).ready(function ()
{
var thisUser = $().SPServices.SPGetCurrentUser();
var userLocation;
$().SPServices(
{
   operation: "GetUserProfileByName",
   async: false,
   AccountName: thisUser,
   completefunc: function (xData, Status)
    {
                  userCountry = getUserProfileValue(xData.responseXML, "country");
     alert(userCountry);
   
     }

    });
});

In this function we are querying the user profile by passing the parameters:

function getUserProfileValue(x, p) {

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


Note that here i am using SPServices, so please do not forget to add the script tags of SPServices as well Jquery also.

Cheers.

Tuesday 26 May 2015

We can store the hyperlinks in the list by creating hyperlink data type, but we will be giving the URL while store into list along with the description. When you try to access the URL using CSOM we will get the URL instead of the description
To get the description using CSOM here we find the way to get it.

clientContext = new SP.ClientContext.get_current();
var vList = clientContext.get_web().get_lists().getByTitle("your listname");
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(‘<view></view>’);
this.collListItem = vList.getItems(camlQuery);   
clientContext.load(collListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this. success),Function.createDelegate(this, thisFailed));


function success(){
try{
var listItemEnumerator = collListItem.getEnumerator();
while(listItemEnumerator.moveNext())
{
var linkDesc = currentItem.get_item('URLfieldname').get_description();
var html = '<a href="'+Link+'">'+linkDesc+'</a>';
 }
You can show your hyperlink description now instead of link by append it to div or any way you want.


Cheers

Wednesday 20 May 2015

We can store the images in the list, but we will be giving the URL of the image while store into list. When you try to access the image using CSOM we will get the URL instead of the image.
To get the image using CSOM here we find the path to get it.

clientContext = new SP.ClientContext.get_current();
var vList = clientContext.get_web().get_lists().getByTitle("your listname");
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(‘<view></view>’);
this.collListItem = vList.getItems(camlQuery);   
clientContext.load(collListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this. success),Function.createDelegate(this, thisFailed));


function success(){
try{
var listItemEnumerator = collListItem.getEnumerator();
while(listItemEnumerator.moveNext())
{
var Image = currentItem.get_item('Imagefieldname').get_url();
var html = <img src="'+ Image+’”;
 }
You can show your image now by append it to div or any way you want.


Cheers

Saturday 16 May 2015

Permission Levels in SharePoint 2010

In SharePoint 2010, we will be having the different permission levels like list level, site level
The below tables will illustrate the permission level and little description.

List Permissions:

Permission Level
Description
Manage Lists
Create and delete lists, add or remove columns in a list, and add or remove public views of a list
Override Check out
Discard or check in a document which is checked out to another user.
Add Items  
Add items to lists and add documents to document libraries.
Edit Items  
Edit items in lists, edit documents in document libraries, and customize Web Part Pages in document libraries.
Delete Items  
Delete items from a list and documents from a document library.
View Items  
View items in lists and documents in document libraries.
Approve Items  
Approve a minor version of a list item or document.
Open Items
View the source of documents with server-side file handlers.
View Versions  
View past versions of a list item or document.
Delete Versions
Delete past versions of a list item or document.
Create Alerts  
Create alerts.
View Application Pageshttp://a1ml11690/_layouts/images/blank.gif
View forms, views, and application Pages. Enumerate lists.

Site Permissions:

Permission Level
Description
Manage Permissions
Create and change permission levels on the Web site and assign permissions to users and groups.
View Web Analytics Data
View reports on Web site usage.
Create Sub sites
Create sub sites such as team sites, Meeting Workspace sites, and Document Workspace sites.
Manage Web Site
Grants the ability to perform all administration tasks for the Web site as well as manage content.
Add and Customize Pages
Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Microsoft SharePoint Foundation-compatible editor.
Apply Themes and Borders
Apply a theme or borders to the entire Web site.
Apply Style Sheets
Apply a style sheet (.CSS file) to the Web site.
Create Groups  
Create a group of users that can be used anywhere within the site collection.
Browse Directories  
Enumerate files and folders in a Web site using SharePoint Designer and Web DAV interfaces.
http://a1ml11690/_layouts/images/blank.gif
Use Self-Service Site Creation  
Create a Web site using Self-Service Site Creation.
View Pages  
View pages in a Web site.
Enumerate Permissions  
Enumerate permissions on the Web site, list, folder, document, or list item.
Browse User Information  
View information about users of the Web site.
Manage Alerts  
Manage alerts for all users of the Web site
Use Remote Interfaces  
Use SOAP, Web DAV, the Client Object Model or SharePoint Designer interfaces to access the Web site.
Use Client Integration Features  
Use features which launch client applications. Without this permission, users will have to work on documents locally and upload their changes.
http://a1ml11690/_layouts/images/blank.gif
Open
Allows users to open a Web site, list, or folder in order to access items inside that container.
Edit Personal User Information  
Allows a user to change his or her own user information, such as adding a picture.

Personal Permissions:

Permission Level
Description
Manage Personal Views
Create, change, and delete personal views of lists
Add/Remove Personal Web Parts
Add or remove personal Web parts on a Web part Page
Update Personal Web Parts
Update Web Parts to display personalized information





Tuesday 12 May 2015

Data View Web Part:

A Data view is a customizable view of data source(list), and it can be used to display data or write back data to a data source.

To create a data view web part , please follow the steps below:

Open the site in SharePoint Designer or Open the site and from the site actions click on Edit site in SharePoint Designer.



Then Open the page if you already created in your site or otherwise create your own.

How to create a page in SPD:

Open SPD and click on the “All files” in the site navigation (left panel)
Click on the “File” in the ribbon and select the type of page you want to create (like html, aspx...)
Name it and click to open the page
Then by click on the “Insert” tab from the ribbon select the “Empty Data view” 
Then “Click here for the data source” and select the list which you want to show as a data view.
Select the columns from the left panel and drag on to the data view
Use the options available in the ribbon inside the Options tab like filter, sort etc. (If you want any kind of sort or filter)
And click on save you are done with your data view
Open the page in the browser to see the web part. 





Monday 11 May 2015

Permission levels in SharePoint 2010

SharePoint has have default permission level in it where we can make use of those permissions for the security purpose. You can find these permission levels inside SharePoint by navigate to site settings page.

Site Actions --> Site Settings --> Users and Permissions --> Site Permissions

From the ribbon click on the permission levels you will find the permission levels

Here the details:

Permission Level
Description
Full Control
Has full control.
Design
Can view, add, update, delete, approve, and customize view and Pages
Contribute
Can view, add, update, and delete list items and documents.
Read
Can view pages and list items and download documents.
Limited Access
Can view specific lists, document libraries, list items, folders, or documents when given permissions.
View only
Can view pages, list items, and documents. Document types with server-side file handlers can be viewed in the browser but not downloaded.
Approve
Can edit and approve pages, list items, and documents.
Manage Hierarchy
Can create sites and edit pages, list items, and documents.
Restricted Read
Can view pages and documents, but cannot view historical versions or user permissions.

Happy Reading :)