Friday, 10 June 2016

Create a workflow with elevated permissions by using the SharePoint 2013 Workflow platform

To allow workflow to use app permissions

  1. Click the Settings icon as shown in the figure.
    Figure: Opening the Site Settings page

    Settings menu
  2. Go to Site Settings.
  3. In the Site Actions section, select Manage site features.
  4. Locate the feature called Workflows can use app permissions, as shown in the figure, and then click Activate.
    Caution note Caution
    This feature will not activate unless you have properly configured the SharePoint 2013 Workflow platform and also apps for SharePoint.
    Figure: The site feature, 'Workflows can use app permissions'

    Workflow can use app permissions feature

Granting full control permission to a workflow

In order for the workflow to function properly it must be granted full control in the site. The following procedure grants the full control permission to the workflow.
Important note Important
The procedure assumes the following:
  • The procedure must be completed by a user that has Site Owner permissions.
  • The workflow must already be published to the SharePoint Server 2013 site.

To grant full control permission to a workflow

  1. Click the Settings icon as shown in the figure.
    Figure: Opening the Site Settings page

    Settings menu
  2. Go to Site Settings.
  3. In the Users and Permissions section, select Site app permissions.
  4. Copy the client section of the App Identifier. This is the identifier between the last "|" and the "@" sign, as shown in the figure.
    Figure: Selecting the App Identifier

    Selecting App Identifier
  5. Navigate to the Grant permission to an app page. This must be done by browsing to the appinv.aspx page of the site.
    Example: http://{hostname}/{catalog site}/_layouts/15/appinv.aspx.
    The following figure shows an example.
    Figure: The appinv.aspx page and URL example

    The appinv.aspx URL example and page.
  6. Paste the client id in the App Id field and then click Lookup, as shown in the figure.
  7. Paste the following Permissions Request XML to grant full control permission.
    <AppPermissionRequests>
        <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
    </AppPermissionRequests>
    
    
    Caution noteCaution
    There are no placeholders in the Scope value above. It is a literal value. Enter it exactly as it appears here.
    The following figure shows an example of the completed page.
    Figure: Looking up an App Id

    Looking up an App Id.
  8. Click Create.
  9. You will then be asked to trust the Workflow app, as shown in the figure. Click Trust It.
    Figure: Trust the Workflow app

    Trust the Workflow app.


Reference link:
https://msdn.microsoft.com/en-us/library/office/jj822159.aspx

Error : Sideloading of apps is not enabled on this site

Hi All,

I have started working on sharepoint app development recently. When I started developing app in visual studio and deployed, got the following errror:
"Sideloading of apps is not enabled on this site".

Reason: I am not using Developer Site Collection

Solution: Two ways we can fix this issue.
1. Create Developer Site Collection and deploy apps.
2. If you are using different site collection other than "Developer Site Template", active the feature as below:

Enable-SPFeature e374875e-06b6-11e0-b0fa-57f5dfd72085 –url "Site Collection URL"

Here we have to activate "Side Loading feature" for non-developer site collections.



What is "App Side Loading"?

App sideloading is the ability to install a SharePoint 2013 App directly into a site to explicitly bypass the regular governance controls of SharePoint. It is a developer/test feature not intended for production use. It is not recommended to sideload apps regularly, or keep app sideloading enabled for longer than you are actively using the feature!

The developer site is designed for app developers to install and test apps before they are ready to release/publish on store.

Hope this helps!!!

Tuesday, 31 May 2016

Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable.

Error: Platform not supported exception

Description:

I was writing a console application using Visual Studio 2012 to use SPSite object of SharePoint 2013.When I ran the application I was getting the following error.

Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable.

Solution:

In the solution explorer right click on the project and then click on Properties. Click on Build tab. Check whether Platform Target is selected as Any CPU. Make sure Prefer-32 bit is not selected.

Monday, 2 May 2016

How to login as different user in SharePoint 2013?

Hi All,

You might face an issue while trying to do sign in as different user in SharePoint 2013.

Here is the url to do :

http//<sharepoint site_url>/_layouts/closeConnection.aspx?loginasanotheruser=true

Hope this helps!!!




Sunday, 1 May 2016

Creating an list Item inside the folder using JSOM


Hello All,

Below code will help you to create an item inside the Folder.

Here is the code:

var clientContext = SP.ClientContext.get_current();
var list = clientContext.get_web().get_lists().getByTitle('Master');

var itemCreateInfo = new SP.ListItemCreationInformation();
itemCreateInfo.set_folderUrl('/Lists/Master/FolderName');

var listItem = list.addItem(itemCreateInfo);
listItem.set_item('Title', 'Hello!');
listItem.update();

clientContext.load(listItem);
clientContext.executeQueryAsync(function (sender, arges) {
    alert('Added');
}, function (sender, arges) {
    alert(arges.get_message());
});

Hope this helps!!!

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!!!