Sunday, 17 April 2016

SharePoint 2013 List Templates

New list template type that are exposed in SharePoint 2013 using Object Model with respect to SharePoint 2010 List Templates. Here is the quick comparison chart.
SP List Template TypeDescription
SP 2013
SP 2010
AccessRequestAccess Request List. Value = 160.
Yes
No
AdminTasksAdministrator Tasks. Value = 1200.
Yes
Yes
AgendaAgenda (Meeting). Value = 201.
Yes
Yes
AnnouncementsAnnouncements. Value = 104.
Yes
Yes
AppDataCatalog
Yes
No
CallTrackCall Track. Value = 404
Yes
Yes
CategoriesCategories (Blog). Value = 303.
Yes
Yes
CirculationCirculation. Value = 405
Yes
Yes
CommentsComments (Blog). Value = 302.
Yes
Yes
ContactsContacts. Value = 105.
Yes
Yes
CustomGridCustom grid for a list. Value = 120.
Yes
Yes
DataConnectionLibraryData connection library for sharing information about external data connections. Value = 130.
Yes
Yes
DataSourcesData sources for a site. Value = 110.
Yes
Yes
DecisionDecisions (Meeting). Value = 204.
Yes
Yes
DesignCatalog
Yes
No
DeveloperSiteDraftAppsDraft Apps library in Developer Site. Value = 1230
Yes
No
DiscussionBoardDiscussion board. Value = 108.
Yes
Yes
DocumentLibraryDocument library. Value = 101.
Yes
Yes
EventsCalendar. Value = 106.
Yes
Yes
ExternalListExternal. Value = 600
Yes
Yes
FacilityFacility. Value = 402
Yes
Yes
GanttTasksProject Tasks. Value = 150.
Yes
Yes
GenericListCustom list. Value = 100.
Yes
Yes
HealthReportsHealth Reports. Value = 1221
Yes
Yes
HealthRulesHealth Rules. Value = 1220
Yes
Yes
HelpLibraryHelp Library. Value = 151.
Yes
No
HolidaysHolidays. Value = 421
Yes
Yes
HomePageLibraryWorkspace Pages (Meeting). Value = 212.
Yes
Yes
IMEDicIME (Input Method Editor) Dictionary. Value = 499
Yes
Yes
InvalidTypeNot used. Value = -1.
Yes
Yes
IssueTrackingIssue tracking. Value = 1100.
Yes
Yes
LinksLinks. Value = 103.
Yes
Yes
ListTemplateCatalogList Template gallery. Value = 114.
Yes
Yes
MaintenanceLogsMaintenance Logs Library. Value = 175.
Yes
No
MasterPageCatalogMaster Page gallery. Value = 116.
Yes
Yes
MeetingObjectiveObjectives (Meeting). Value = 207.
Yes
Yes
MeetingsMeeting Series (Meeting). Value = 200.
Yes
Yes
MeetingUserAttendees (Meeting). Value = 202.
Yes
Yes
MySiteDocumentLibrary
Yes
No
NoCodePublicNo Code Public Workflow. Value = 122
Yes
Yes
NoCodeWorkflowsNo Code Workflows. Value = 117.
Yes
Yes
NoListTemplateunspecified list type. Value = 0
Yes
Yes
PictureLibraryPicture library. Value = 109.
Yes
Yes
PostsPosts (Blog). Value = 301.
Yes
Yes
SolutionCatalogSolutions. Value = 121
Yes
Yes
SurveySurvey. Value = 102.
Yes
Yes
TasksTasks. Value = 107.
Yes
Yes
TasksWithTimelineAndHierarchyTasks with Timeline and Hierarchy. Value = 171.
Yes
No
TextBoxText Box (Meeting). Value = 210.
Yes
Yes
ThemeCatalogThemes. Value = 123
Yes
Yes
ThingsToBringThings To Bring (Meeting). Value = 211.
Yes
Yes
TimecardTimecard. Value = 420
Yes
Yes
UserInformationUser Information. Value = 112.
Yes
Yes
WebPageLibraryWiki Page Library. Value = 119.
Yes
Yes
WebPartCatalogWeb Part gallery. Value = 113.
Yes
Yes
WebTemplateCatalogSite template gallery. Value = 111.
Yes
Yes
WhereaboutsWhereabouts. Value = 403
Yes
Yes
WorkflowHistoryWorkflow History. Value = 140.
Yes
Yes
WorkflowProcessCustom Workflow Process. Value = 118.
Yes
Yes
XMLFormXML Form library. Value = 115.
Yes
Yes

Get If-Else Condition in SharePoint Designer 2013 Workflow

Here is simple requirement in Sharepoint designer, we may need if else condition while developing 
workflows. Auto-population will work with the If condition, but Else wont work. We may see below error. 



The "Else" branch is not available from the auto complete.

To Overcome this issue we need to follow below steps.
  1. It is available by the menu bar at the top.
  2. If you are inside the if block, use keyboard shortcut (Alt + W + B)

Hope this helps!!!

Monday, 4 January 2016

How to get rid of default emails from task list

Hello All,

I have a requirement while creating the custom workflow. Here I am sending custom emails by configuring email settings in the task process. However, I am getting two emails one is custom and other is default.

To overcome this situation. I followed below steps.

1. Go to List Settings(Task List)
2. Go to Advanced settings
3. Modify Email settings to "No"



4. Click "OK" to Save Settings.
It solved my problem.

Thanks!!!

Saturday, 21 November 2015

Error: App Management Shared Service Proxy is Not Installed

Introduction

I created a SharePoint 2013 workflow using Designer and when I tried to publish the workflow I was getting the following error:
Error Message

Errors were found when compiling the workflow. The workflow files were saved but cannot be run.

Microsoft.SharePoint.SPException: App Management Shared Service Proxy is not installed.

Reason

This is because the App Management Service application is not created or the App Management Service is not running or the App Management Service Proxy is not added to the default proxy group.

Solution
  1. Open "Central Administration".
  2. Click on "Application Management" in the quick launch bar.
  3. Click on "Manage Service Applications" available under the Service Applications section.
  4. Check whether the App Management Service application is created, if not then create the App Management Service application.
  5. Click on "Application Management" in the quick launch bar.
  6. Click on "Configure service application associations" available under the Service Applications section.
  7. Check whether the App Management Service proxy is added to the default proxy group, if not then add it to the default proxy group.
  8. Click on "Application Management" in the quick launch bar.
  9. Click on "Manage services on server" available under the Service Applications section.
  10. Check whether the App Management Service is started, if not then start the service.
Below article helps me to resolve the issue:
http://www.c-sharpcorner.com/UploadFile/anavijai/error-app-management-shared-service-proxy-is-not-installed/

Thanks

Sunday, 27 September 2015

Trying to use an SPWeb object that has been closed or disposed and is no longer valid


You get above error if the code is trying to access the SPSite or SPweb object which was disposed.

Trying to use an SPWeb object that has been closed or disposed and is no longer valid.

If you have code with SPContext, do not dispose the SPWeb or SPSite objects. You can’t dispose the SPcontext objects

i.e.  we cant dispose the object SPContext.current.Web or SPContext.Current.Site directly

when you say SPWeb spWeb= SPContext.Current.Web we are not creating a new instance of spweb, we are referring to the existing instance of the web object which is already there in SPContext. if you use using (SPWeb spWeb= SPContext.Current.Web), using will dispose the spWeb object after control goes out of its scope. here catch is, you are disposing an object which is not created by you.


using (SPSite mySiteCollection = SPContext.Current.Site)
{
using (SPWeb mySite = mySiteCollection.OpenWeb())
{

}
}
Above code gives you exception

so you can rewrite as

using (SPSite mySiteCollection = new SPSite(SPContext.Current.Site.Url))
{
using (SPWeb mySite = mySiteCollection.OpenWeb())
{

}
}
or don’t use using when you use SPContext.

Hope this helps!!!

List All SharePoint PowerShell Commands


Hi All,

Here is the simple way to list all Power shell commands.

1. To know the total count:
    Get Count: (Get-Command -PSSnapin Microsoft.SharePoint.PowerShell).count

2. List of all commands : 
    Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell” | select name, definition | fl > C:\PowerShell_Commands.txt

Above command gives the text file which will have all the powershell commands.

Cheers

JavaScriptObjectModel in SharePoint(JSOM)

Hi All,

We have JSOM is SharePoint. Lets see with different examples.

All these example can be placed in Content Editor webpart to test.

Example 1: Modify the Title of specific list item based on ID

<script type="text/javascript">
var clientContext = null;
var web = null;

function Initialize()
{
clientContext = new SP.ClientContext.get_current();
web = clientContext.get_web();
this.list = web.get_lists().getByTitle('Genericlist');
this.oListItem = list.getItemById(1);
oListItem.set_item('Title', 'NewTitle updated');
oListItem.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onUpdateListItemSuccess), Function.createDelegate(this, this.onQueryFailed));
}
function onUpdateListItemSuccess(sender, args) {
alert("list item updated");
}
function onQueryFailed(sender, args) {
alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
}</script>​​​
<button onclick="Initialize()">Insert</button>​​

Example 2: How to get the Created date and Last Modified date of a Site?

<div id="display"></div>  
<!-- Script Content -->  
<script type='text/javascript'>  
var oWeb;  
function getwebdetails()  
{  
    var clientContext = SP.ClientContext.get_current(); // equivalent to SPContext.Current  
    oWeb = clientContext.get_web(); //Gets the current Web Object    
    clientContext.load(oWeb,'Title', 'Created', 'LastItemModifiedDate');  
    clientContext.executeQueryAsync(onSucceeded,onFailed);  
}  
function onSucceeded()  
{  
    var strmsg = "";
    strmsg += "<b>Web Title:</b> " + oWeb.get_title() +"<br/>";
    strmsg += "Created Date: "+ oWeb.get_created()+"<br/>";
    strmsg += "Last Modified Date: "+ oWeb.get_lastItemModifiedDate();  
    document.getElementById("display").innerHTML = strmsg;
}  
function onFailed(sender, args)  
{  
    try  
    {  
        console.log('Error: ' + args.get_message());  
    }  
    catch (err)  
    {  
    }  
}  
ExecuteOrDelayUntilScriptLoaded(getwebdetails, "sp.js");  
</script>

Example 3: Get current loggedin user,id and usertitle

<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(init,'sp.js');
var currentUser;
function init(){
    this.clientContext = new SP.ClientContext.get_current();
    this.oWeb = clientContext.get_web();
    currentUser = this.oWeb.get_currentUser();
    this.clientContext.load(currentUser);
    this.clientContext.executeQueryAsync(Function.createDelegate(this,this.onQuerySucceeded), Function.createDelegate(this,this.onQueryFailed));
}

function onQuerySucceeded() {
    document.getElementById('userLoginName').innerHTML = currentUser.get_loginName();
    document.getElementById('userId').innerHTML = currentUser.get_id();
    document.getElementById('userTitle').innerHTML = currentUser.get_title();  
}

function onQueryFailed(sender, args) {
    alert('Request failed. \nError: ' + args.get_message() + '\nStackTrace: ' + args.get_stackTrace());
}
</script>
<div>Current Logged User:
    <span id="userLoginName"></span>
    <span id="userId"></span>
    <span id="userTitle"></span>  
</div>

Get ItemsCount in a sharepoint list:

<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.js"></script>

<script type="text/ecmascript">
    var customlist ;
    function GetListInformation() {
        var clientContext = new SP.ClientContext.get_current();
        var oWebsite = clientContext.get_web();
        customlist = oWebsite.get_lists();
        clientContext.load(customlist);
        clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    }      

    function onQuerySucceeded() {    
alert("Success");
         alert("Item Count : " + this.customlist.get_itemCount());
    }

    function onQueryFailed(sender, args) {
        alert(" Failed");
    }      
</script>

<button type="button" onclick="GetListInformation()">Click Me!</button>

Hope this helps!!!