id
stringlengths
14
16
text
stringlengths
2
3.14k
source
stringlengths
45
175
6ccf9c522cf3-16
var pageLayout = item["PublishingPageLayout"] as FieldUrlValue; if (pageLayout != null) { LayoutFile matchingLayout = pageLayouts.FirstOrDefault(p => pageLayout.Url.EndsWith("/" + p.Replaces)); if (matchingLayout != null) { // Check out the page so that we can update the page layout. ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-files-deployed-using-modules-in-sharepoint-farm-solutions
6ccf9c522cf3-17
// Update the pageLayout reference. pageLayout.Url = pageLayout.Url.Replace(matchingLayout.Replaces, matchingLayout.File); item["PublishingPageLayout"] = pageLayout; item.Update(); File file = item.File; // Get the file and other attributes so that you can check in the file. clien...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-files-deployed-using-modules-in-sharepoint-farm-solutions
bb4f1576a804-0
This article describes the transformation process to use when replacing content types and site columns, adding site columns to new content types, and then replacing previous content types with new content types by using the SharePoint client-side object model (CSOM). Important Farm solutions cannot be migrated to...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-1
} In the following code, GetContentTypeByName gets a content type from the current site by: Using the Web.ContentTypes property to get a ContentTypeCollection , which is a collection of content types on the current site. Finding and then returning a content type from the site, by matching the site con...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-2
// The content type exists already. No further action required. if (contentType != null) return; // Create the content type using the ContentTypeInformation object. ContentTypeCreationInformation newCt = new ContentTypeCreationInformation(); newCt.Name = "ContosoDocumentByCSOM"; // Create the new ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-3
// Check fields on the site for a match. var fieldExists = fields.Any(f => f.InternalName == fieldName); // The field exists already. No further action required. if (fieldExists) return;
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-4
// Field does not exist, so create the new field. string FieldAsXML = @"<Field ID='{CB8E24F6-E1EE-4482-877B-19A51B4BE319}' Name='" + fieldName + @"' DisplayName='Contoso String by CSOM' Type='Text' ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-5
// Load field references in the content type. cc.Load(contentType.FieldLinks); cc.ExecuteQuery(); // Load the new field. Field fld = web.Fields.GetByInternalNameOrTitle(fieldName); cc.Load(fld); cc.ExecuteQuery(); // Determine whether the content type refers to the field. var hasFieldC...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-6
// The reference does not exist, so we have to create the reference. FieldLinkCreationInformation link = new FieldLinkCreationInformation(); link.Field = fld; contentType.FieldLinks.Add(link); contentType.Update(true); cc.ExecuteQuery(); } Replace old content type references with the new content ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-7
Getting all list items in the list. For each list item, getting the content type ID of the list item. Determine whether the content type ID of the list item is equal to the old content type ID. If the content type IDs are not equal, skip to the next list item. If the content type IDs are equal, use ContentType.Str...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-8
// Get the new content type and lists on the site. ContentType newContentType = GetContentTypeByName(cc, web, newContentTypeName); ListCollection lists = web.Lists; // Load the new content type and the content types on all lists on the site. cc.Load(newContentType); cc.Load(lists, ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
bb4f1576a804-9
// Update the list item content type to the new content type. listItem["ContentTypeId"] = newContentType.StringId; // new content type Id; listItem.Update(); } // Save all changes. cc.ExecuteQuery(); } } See also Transform farm solutions to the SharePoint Add-i...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/replace-sharepoint-content-types-and-site-columns
6679fbe98bd8-0
If you have extended your SharePoint environment by using farm solutions, and you want to migrate your extensions to the SharePoint Add-in model to make your transition to SharePoint Online easier, you need to transform your farm solutions to the SharePoint Add-in model. Transforming your farm solutions to the ShareP...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/transform-farm-solutions-to-the-sharepoint-app-model
6679fbe98bd8-1
For each farm solution, determining whether to replace it with a SharePoint Add-in. Some solutions, such as SharePoint administration extensions, cannot be duplicated in the SharePoint Add-in model. For more information, see SharePoint Application Lifecycle Management and SharePoint Add-ins compared with SharePoint ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/transform-farm-solutions-to-the-sharepoint-app-model
6679fbe98bd8-2
Description Advantages Disadvantages In-place Deploy your new SharePoint Add-in into your existing SharePoint environment. You must ensure that your site is using the new SharePoint Add-in before retracting the farm solution. Less overall user impact. Fewer resources needed because you are using your ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/transform-farm-solutions-to-the-sharepoint-app-model
6679fbe98bd8-3
To replace page layouts and master pages: Upload the new page layout or master page to your site. Upload new master pages and page layouts to your site collection either manually or by using remote APIs. Remote APIs include the client-side object model (CSOM) or REST. This ensures that the master pages and page lay...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/transform-farm-solutions-to-the-sharepoint-app-model
6679fbe98bd8-4
Page manipulation You might need to implement page manipulation during your custom site provisioning process. The Provisioning.Pages code sample shows page manipulation techniques, including creating a wiki page, adding HTML content to the page, creating a promoted links list, creating pages with different layouts...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/transform-farm-solutions-to-the-sharepoint-app-model
6679fbe98bd8-5
Note If your timer job uses server-side code, you must redesign your timer job to use the CSOM or another method. In this section Article Shows you how to Replace content types and site columns Use CSOM to replace SharePoint content types and site columns, add site columns to new content typ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/transform-farm-solutions-to-the-sharepoint-app-model
83d9967c8b52-0
Summary The approach you take to integrate Yammer with SharePoint is the same in the new SharePoint Add-in model as it is with Full Trust Code. High Level Guidelines As a rule of a thumb, we would like to provide the following high level guidelines to integrate Yammer with SharePoint. Yammer integration may b...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
83d9967c8b52-1
This option allows you to control limited aspects of the feed and how it appears. Using embed looks like this in your SharePoint page: The following table describes each type of Yammer feed you can access with embed out-of-the-box. Feed Description FeedType Use Case My Feed My Feeds ar...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
83d9967c8b52-2
When is it a good fit? When you are trying to integrate Yammer feeds with SharePoint sites and the out-of-the-box capabilities of the embed feed meet your needs. Getting Started The following sample demonstrates how to provision sites with a Yammer feed associated with the site in place of the default news feed f...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
83d9967c8b52-3
wp.Append(" </metaData>"); wp.Append(" <data>"); wp.Append(" <properties>"); wp.Append(" <property name='Title' type='string'>$Resources:core,ScriptEditorWebPartTitle;</property>"); wp.Append(" <property name='Description' type='string'>$Resources:core,ScriptEditorWebPartDescription;</property...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
83d9967c8b52-4
return wp.ToString(); } The CreateYammerOpenGraphDiscussionPartXml method in the YammerUtility.cs class comes from the OfficeDevPnP.Core sample. This method creates the XML for an Add-in Part definition that is added to a SharePoint page when a site is provisioned. Notice the feedType: 'open-graph' portion...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
83d9967c8b52-5
wp.Append(" <property name='Description' type='string'>$Resources:core,ScriptEditorWebPartDescription;</property>"); wp.Append(" <property name='ChromeType' type='chrometype'>None</property>"); wp.Append(" <property name='Content' type='string'>"); wp.Append(" <![CDATA["); wp.Append(" ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
83d9967c8b52-6
wp.Append(" , objectProperties: {"); wp.Append(" url: '" + url + "'"); wp.Append(" , type: 'page'"); wp.Append(" , title: '" + postTitle + "'"); wp.Append(" , image: '" + postImageUrl + "'"); wp.A...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
83d9967c8b52-7
return wp.ToString(); } Watch the Integrate Yammer feeds to SharePoint sites (O365 PnP Video) to see a walk through of the - Provisioning.Yammer (O365 PnP Sample) . For more information about Yammer embed see the Yammer Embed Feed (Yammer Developer Center) article. For more information about Yammer OpenGrap...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
83d9967c8b52-8
For more information about Yammer REST APIs see the REST API & Rate Limits (Yammer Developer Center) article. Authentication Note In a scenario where you sign into SharePoint with credentials that differ from the credentials you use to sign into SharePoint with you may wish to develop a single-sign-on capability ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/yammer-integration-sharepoint-add-in
3535a253f96a-0
Summary The approach you take to implement workflows and their associated components is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, workflows and their associated components were built with server side code and deployed v...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
3535a253f96a-1
Workflows created in Visual Studio are automatically packaged inside features for deployment. Workflows created in SharePoint designer must be exported and imported to deploy them from a development server to a production server. Workflows may also be deployed and associated with the Host-web in SharePoint via the ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
3535a253f96a-2
//Create a new WorkflowProvisionService class instance which uses the //Microsoft.SharePoint.Client.WorkflowServices.WorkflowServicesManager to //provision and configure workflows var service = new WorkflowProvisionService(clientContext); //Read the workflow .XAML file var incidentWF = System.IO...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
3535a253f96a-3
deploymentService.PublishDefinition(result.Value); ClientContext.ExecuteQuery(); return result.Value; } public Guid Subscribe(string name, Guid definitionId, Guid targetListId, WorkflowSubscritpionEventType eventTypes, Guid taskListId, Guid historyListId) { var eventTypesList = new Li...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
3535a253f96a-4
When is it a good fit? When you need to create custom workflows with code behind them this option is a good fit. Getting Started The following articles demonstrate how to create custom workflows. Create a SharePoint workflow app using Visual Studio 2012 (MSDN Article) How to: Create SharePoint 2013 Workflow...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
3535a253f96a-5
Getting Started The Workflow.CustomEvents (O365 PnP Sample) demonstrates how to create a workflow that waits for a custom even to fire before proceeding. It also demonstrates how to use the JavaScript Client Side Object Model (JSOM) for the Workflow Services Manager to raise a custom event. Create custom workflo...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
3535a253f96a-6
This approach requires passing the content token from the workflow to the web service. When is it a good fit? When you want the communication to SharePoint to occur at the client level. Getting Started The following sample demonstrates how to use the context token and the Add-in web URL to authenticate to Sha...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
3535a253f96a-7
Workflow.CallServiceUpdateSPViaProxy (O365 PnP Sample) See the Call Web Api service via web proxy section in the Workflow.CallServiceUpdateSPViaProxy (O365 PnP Sample) README for more details about the SharePoint Web Proxy invocation. The other sections in the Workflow.CallServiceUpdateSPViaProxy (O365 PnP S...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
3535a253f96a-8
Videos at https://aka.ms/OfficeDevPnPVideos PnP samples Workflow.Activities (O365 PnP Sample) Workflow.CustomEvents (O365 PnP Sample) Workflow.CustomTasks (O365 PnP Sample) Workflow.CallCustomService (O365 PnP Sample) Workflow.CallServiceUpdateSPViaProxy (O365 PnP Sample) Samples and content at Micr...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/workflows-actions-events-and-forms-sharepoint-add-in
59e5002bc93d-0
Implement real-time communication between SharePoint app parts by using SignalR. Applies to: add-ins for SharePoint | SharePoint 2013 | SharePoint Online The Core.ConnectedAppParts sample shows you how to use a provider-hosted app as a message broker or chat hub to send and receive messages from all app parts c...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/connect-sharepoint-app-parts-by-using-signalr
59e5002bc93d-1
Use the Core.ConnectedAppParts app To see a demo of two app parts communicating by using SignalR: When you run the app and the start page is displayed, choose Back to Site . Choose Settings > Add a page . In New page name , enter ConnectedAppParts , and then choose Create . Choose In...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/connect-sharepoint-app-parts-by-using-signalr
59e5002bc93d-2
Connect to the SignalR Hub Proxy using connection.chatHub . Use chat.client.broadcastMessage to define a function to receive broadcasted messages sent by the chat hub. In this code sample, the name of the app part and the message being broadcasted is displayed in the discussion list. Start the connection...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/connect-sharepoint-app-parts-by-using-signalr
59e5002bc93d-3
var encodedName = $('<div />').text(name).html(); var encodedMsg = $('<div />').text(message).html(); // Add the message to the page. $('#discussion').append('<li><strong>' + encodedName + '</strong>:&amp;nbsp;&amp;nbsp;' + encodedMsg + '</li>'); ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/connect-sharepoint-app-parts-by-using-signalr
59e5002bc93d-4
See also Office 365 development patterns and practices solution guidance Introduction to SignalR Tutorial: Getting Started with SignalR 2
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/connect-sharepoint-app-parts-by-using-signalr
d58351bbfc7d-0
Deploy pre-configured, standard SharePoint web parts for your users. Applies to: SharePoint 2013 | SharePoint Add-ins | SharePoint Online You can upload pre-configured, standard SharePoint web parts for users to add to their SharePoint sites. For example, you can upload a pre-configured: Script Editor Web Part...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-web-parts-in-sharepoint
d58351bbfc7d-1
Choose Add . In the drop-down in the upper-right corner of the User profile information Web Part, choose Edit Web Part . Choose EDIT SNIPPET . Review the <SCRIPT> element. Notice that the src attribute links to a JavaScript file on the remote web. The <SCRIPT> element is set by the Content p...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-web-parts-in-sharepoint
d58351bbfc7d-2
Gets a reference to the Web Part Gallery folder. Uses FileCreationInformation to create the userprofileinformation.webpart file to upload from the provider-hosted add-in to the Web Part Gallery . The folder.Files.Add method adds the file to the Web Part Gallery . Retrieves all list items in the Web Par...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-web-parts-in-sharepoint
d58351bbfc7d-3
// Upload the "userprofileinformation.webpart" file. using (var stream = System.IO.File.OpenRead( Server.MapPath("~/userprofileinformation.webpart"))) { FileCreationInformation fileInfo = new FileCreationInformation(); ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-web-parts-in-sharepoint
1c1dac62fa13-0
The approach you take to create portable page components is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, web parts were created to implement portable page components. In an SharePoint Add-in model scenario, Add-in Parts (A...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/web-part-sharepoint-add-in
1c1dac62fa13-1
Core.AppScriptPart (O365 PnP Sample) The following video walks you through the code sample. Core.AppScriptPart (O365 PnP Video) Related links Introducing app script part pattern for Office365 app model (MSDN Blog Article) Core.AppScriptPart (O365 PnP Video) Guidance articles at https://aka.ms/Offic...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/web-part-sharepoint-add-in
e71de1a36246-0
Summary The approach you take to configure variations is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, the SharePoint Server-side Object Model (Microsoft.SharePoint.Publishing.Variations) was used to configure variations, an...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/variations-sharepoint-add-in
e71de1a36246-1
Related links Guidance articles at https://aka.ms/OfficeDevPnPGuidance References in MSDN at https://aka.ms/OfficeDevPnPMSDN Videos at https://aka.ms/OfficeDevPnPVideos PnP samples VariationsExtensions.cs class (O365 PnP Sample) Samples and content at Microsoft 365 Patterns and Practices (PnP) ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/variations-sharepoint-add-in
0395ace1695a-0
The approach you take to perform Create, Read, Update and Delete (CRUD) operations in the user profile service is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, UPS CRUD operations were performed with the SharePoint server-side...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/user%20profile%20manipulation-sharepoint-add-in
0395ace1695a-1
Supported Not Supported You typically will not deploy an Add-in to a SharePoint tenancy to handle UPS data copying or synchronization. Usually, the Add-in takes the form of a console application running as a scheduled task, or a long-running cloud service such as an Azure Web Job. See the Remote timer ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/user%20profile%20manipulation-sharepoint-add-in
0395ace1695a-2
When is it a good fit? When you have an on-premises SharePoint environment and you are performing a one-way copy of profile attributes, this is a good option because it may be implemented quickly and easily without writing any code. On-premises - Use the User Profile Web Service to copy data If you have an on-pre...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/user%20profile%20manipulation-sharepoint-add-in
0395ace1695a-3
Office 365 - Use CSOM to copy data If you have an Office 365 SharePoint environment you can use CSOM to copy UPS data from one tenancy to another. When is it a good fit? When you have an Office 365 environment and you are copying UPS data between two or more SharePoint tenancies this is a good option because it g...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/user%20profile%20manipulation-sharepoint-add-in
0395ace1695a-4
Related links User profile CSOM for reading and updates (O365 PnP Video) Remote timer jobs (SharePoint Add-in Model Recipe) Default user profile property mappings in SharePoint Server 2013 (TechNet article) Guidance articles at https://aka.ms/OfficeDevPnPGuidance References in MSDN at https://aka.ms/Offic...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/user%20profile%20manipulation-sharepoint-add-in
9290d08b8352-0
The approach you take to implement custom controls in your code is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, custom controls were built as user controls or web controls and deployed via SharePoint Solutions. In a SharePo...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/user-controls-and-web-controls-sharepoint-add-in
9290d08b8352-1
In this pattern, JavaScript is embedded directly in page layouts in publishing sites. This approach is absolutely supported and is a valid approach. This approach works with publishing sites. When is it a good fit? When you need to embed JavaScript into specific SharePoint page layouts in publishing sites i...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/user-controls-and-web-controls-sharepoint-add-in
9290d08b8352-2
Core.JavaScriptCustomization (O365 PnP Scenario using PnP Core component) Samples and content at Microsoft 365 Patterns and Practices (PnP) Applies to Office 365 Multi Tenant (MT) Office 365 Dedicated (D) SharePoint 2013 on-premises
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/user-controls-and-web-controls-sharepoint-add-in
a8047d1207c9-0
Implement asynchronous operations in SharePoint Add-ins by using Microsoft Azure WebJobs. Applies to: SharePoint 2013 | SharePoint Add-ins | SharePoint Online The Core.QueueWebJobUsage sample shows you how to create and run asynchronous operations by using provider-hosted add-ins and Azure WebJobs in Office 365....
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-1
Note Adding a message to the Azure Storage queue uses a different process from the process that runs the Azure WebJob. Therefore, your add-in can implement asynchronous operations by adding new messages to the queue using one process, and then by using the Azure WebJob to handle those messages in another process. ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-2
In Properties on the Core.QueueWebJobUsage.Job, set Copy Local to True on the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime references. Setting Copy Local to True copies the referenced assemblies to Azure so that the Azure WebJob can resolve the references to these assemblies. D...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-3
Helper Project\Core.QueueWebJobUsage.Console.SendMessage\app.config StorageConnectionString Replace [Your Account name] with the storage account name copied from the Azure portal. Replace [Your Account Key] with the primary access key copied from the Azure portal. Core.QueueWebJobUsageWeb\web.co...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-4
Replace [YourKey] with the primary access key copied from the Azure portal. Note If the ClientId and the ClientSecret in Core.QueueWebJobUsageWeb gets updated, for example, when you increment the version number in the AppManifest.xml, make sure you update the ClientId and the ClientSecret in the ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-5
When you run the Core.QueueWebJobUsage code sample, the provider-hosted add-in appears and displays two buttons: Synchronous operation and Asynchronous operation . When you choose Synchronous operation , btnSync_Click in Pages\Default.aspx simulates a long-running synchronous process. In this code sample, btn...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-6
var spContext = SharePointContextProvider.Current.GetSharePointContext(Context); using (var clientContext = spContext.CreateUserClientContextForSPHost()) { // Get the current user. var currUser = clientContext.Web.CurrentUser; clientContext.Load(c...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-7
// Get queue or create a new one if one does not exist. CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient(); CloudQueue queue = queueClient.GetQueueReference(SiteManager.StorageQueueName); queue.CreateIfNotExists();
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-8
// Add a message to queue. queue.AddMessage(new CloudQueueMessage(JsonConvert.SerializeObject(modifyRequest))); } After the message is added to the Azure Storage Queue, a continuously running Azure WebJob waits for and then processes the new message. The Azure WebJob is defined in Core.QueueWebJo...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-9
public static void ProcessQueueMessage( [QueueTrigger(SiteManager.StorageQueueName)] SiteModifyRequest modifyRequest, TextWriter log) { log.WriteLine(string.Format("{0} '{1}' {2} '{3}'.", "Received new site modification request with URL", ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
a8047d1207c9-10
// Get the access token for the URL. // Requires this add-in to be registered with the tenant. string accessToken = TokenHelper.GetAppOnlyAccessToken( TokenHelper.SharePointPrincipal, ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-asynchronous-operations-in-sharepoint-add-ins
77a87ca9ff22-0
The approach you take to provision site collections and sub sites is different in the new SharePoint Add-in model, compared to how it was in Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, you would create site collections and sub sites with the site definitions and web templates and then ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
77a87ca9ff22-1
Creating in a web browser vs. Creating with code It is important to understand that creating site collections and sub sites via the web browser and via code are different. This list describes the different options. Creating via a web browser In this option, users access a SharePoint site via a web browser and...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
77a87ca9ff22-2
These factors make creating site collections and sub sites with code prone to success . You can easily and consistently replicate site collections and sub sites (and the components they contain) created via code in a granular fashion. You can easily deploy the site collections and sub sites to different e...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
77a87ca9ff22-3
Override the create site link Override the create sub site link Use a Provider-hosted SharePoint Add-in Use .NET/Java/Objective-C applications or PowerShell scripts Override the create site link In this pattern, the link to create a site collection is overridden with a link that points to a Provider-hosted ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
77a87ca9ff22-4
Getting Started The following articles describe the override create site link pattern and provide code samples to get you started. Self-Service Site Provisioning using add-ins for SharePoint 2013 (MSDN Blog) End-to-end article about this pattern with accompanying video. Provisioning.Cloud.Sync (O365 PnP...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
77a87ca9ff22-5
Getting Started The following articles describe the override create sub site link pattern and provide code samples to get you started. Provisioning.Cloud.Sync (O365 PnP Sample) This solution shows the model for providing synchronous site collection or sub site creation experience to introduce a model for site...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
77a87ca9ff22-6
When is it a good fit? This option works well when you need to provide your end users with a self-service ability to create SharePoint site collections and sub sites based on custom templates. Note that you will need to provide your users a link to the Provider-hosted application so they can access it. Async pro...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
77a87ca9ff22-7
CSOM/REST APIs may also be used to configure other aspects of the site during the provisioning process. This approach may be used in Office 365 tenants and in on-premises SharePoint. Provides a tremendous amount of flexibility to create and configure SharePoint sites. Easy and inexpensive to implement and mai...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
77a87ca9ff22-8
PnP samples Provisioning.Cloud.Sync (O365 PnP Sample) Provisioning.SubSiteCreationApp (O365 PnP Sample) Provisioning.Services.SiteManager (O365 PnP Sample) Provisioning.SiteCollectionCreation (O365 PnP Sample) Samples and content at https://github.com/SharePoint/PnP Applies to Office 365 Multi Tena...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-provisioning-sharepoint-add-in
1ddcae23a95c-0
The approach you take to create site columns and content types in SharePoint sites is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, you use declarative code to create site columns and content types. In the declarative code app...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-columns-and-content-types-sharepoint-add-in
1ddcae23a95c-1
Usually the only time you will use the web browser to manually create site columns and content types is when you are prototyping or modifying a single SharePoint site that is not planned to grow to include other site collections or sub sites. Creating with code In this option, you execute SharePoint CSOM/REST...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-columns-and-content-types-sharepoint-add-in
1ddcae23a95c-2
Must happen quickly! You typically create site columns and content types when you provision a SharePoint site. End users won't accept having to wait several hours for you to provision their new SharePoint sites. Must be consistently perfect! Site columns and content types are the foundation that define your infor...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-columns-and-content-types-sharepoint-add-in
1ddcae23a95c-3
There are many different articles and samples you can use to learn how to make site columns and content types with the CSOM. Here you will find these examples (classified by the pattern that is used to invoke the CSOM code) to create site columns and content types. Use a Provider-hosted SharePoint Add-in This optio...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-columns-and-content-types-sharepoint-add-in
1ddcae23a95c-4
Guidance articles at https://aka.ms/OfficeDevPnPGuidance References in MSDN at https://aka.ms/OfficeDevPnPMSDN Videos at https://aka.ms/OfficeDevPnPVideos PnP samples Core.CreateContentTypes (O365 PnP Sample) Core.ContentTypesAndFields (O365 PnP Sample) Core.CreateDocumentContentType (O365 PnP Sample...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/site-columns-and-content-types-sharepoint-add-in
8814c2ab3ed7-0
Use ChangeQuery and ChangeToken to query the SharePoint change log for changes made to a SharePoint content database, site collection, site, or list. Applies to: SharePoint 2013 | SharePoint Add-ins | SharePoint Online You can query the SharePoint change log by using ChangeQuery and ChangeToken to find an...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/query-sharepoint-change-log-with-changequery-and-changetoken
8814c2ab3ed7-1
Choose Site Contents . Choose add an add-in . Choose Custom List . In Name , enter TestList . Choose Create . To see a demo of this code sample, perform the following steps: Choose Start in Visual Studio. Enter your Office 365 site's URL, the name of the list ( TestList ), a...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/query-sharepoint-change-log-with-changequery-and-changetoken
8814c2ab3ed7-2
Set ChangeToken.StringValue with the version number, change scope, GUID of TestList , date and time when changes occurred, and the change item value on the ChangeToken (initialize with a value of -1). This code sample limits the amount of changes read from the change log by initializing the date and time when the c...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/query-sharepoint-change-log-with-changequery-and-changetoken
8814c2ab3ed7-3
Console.WriteLine(string.Format("Connecting to {0}", url)); Console.WriteLine(); ClientContext cc = new ClientContext(url); cc.AuthenticationMode = ClientAuthenticationMode.Default; cc.Credentials = new SharePointOnlineCredentials(userName, password); ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/query-sharepoint-change-log-with-changequery-and-changetoken
8814c2ab3ed7-4
Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(string.Format("Ctrl+c to exit. Press \"r\" key to force the console application to read the change log without waiting {0} seconds.", WaitSeconds)); Console.WriteLine(); Console.ResetColor(); do...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/query-sharepoint-change-log-with-changequery-and-changetoken
1df3cfbc628c-0
The approach you take to configure search is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, the SharePoint Server-side Object Model was used to configure search, and deployed via SharePoint Solutions. In an SharePoint Add-in ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-configuration-sharepoint-add-in
1df3cfbc628c-1
PnP samples Core.SearchSettingsPortability (O365 PnP Sample) Samples and content at Microsoft 365 Patterns and Practices (PnP) Applies to Office 365 Multi Tenant (MT) Office 365 Dedicated (D) SharePoint 2013 on-premises
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-configuration-sharepoint-add-in
bbe3fa7a4966-0
The approach you take to execute searches with the SharePoint Search Service is different in the new SharePoint Add-in model than it was with Full Trust Code. In a typical Full Trust Code (FTC) / Farm Solution scenario, the SharePoint server-side object model (Content By Query web part overrides) or the Search Web Ser...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-api-usage-sharepoint-add-in
bbe3fa7a4966-1
Some examples of these scenarios are ASP.NET MVC websites, ASP.NET Web API services, .Net console or Windows applications, and Azure Web Jobs. Getting Started The following sample demonstrates how to execute searches with the SharePoint Search Service with the .Net CSOM API. This example also demonstrates how to...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-api-usage-sharepoint-add-in
bbe3fa7a4966-2
using (var clientContext = spContext.CreateUserClientContextForSPHost()) { // Since in this case we want only site collections, let's filter based on result type string query = searchtext.Text + " contentclass:\"STS_Site\""; ClientResult<ResultTableCollection> results = ProcessQuery(clientCo...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-api-usage-sharepoint-add-in
bbe3fa7a4966-3
using (var clientContext = spContext.CreateUserClientContextForSPHost()) { // Load user profile properties PeopleManager peopleManager = new PeopleManager(clientContext); PersonProperties personProperties = peopleManager.GetMyProperties(); clientContext.Load(personProperties); ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-api-usage-sharepoint-add-in
bbe3fa7a4966-4
return ""; } In both cases, the ProcessQuery method in the Default.aspx.cs class uses the SearchExecutor class to execute the search query and return the results. private ClientResult<ResultTableCollection> ProcessQuery(ClientContext ctx, string keywordQueryValue) { KeywordQuery keywordQuery = new KeywordQ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-api-usage-sharepoint-add-in
bbe3fa7a4966-5
var searchExecutor = new Microsoft.SharePoint.Client.Search.Query.SearchExecutor(context); results = searchExecutor.executeQuery(keywordQuery); context.executeQueryAsync(onGetEventsSuccess, onGetEventsFail); REST API In this option you use the REST API to execute searches with the SharePoint Search Service. ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-api-usage-sharepoint-add-in
bbe3fa7a4966-6
string accessToken = spContext.UserAccessTokenForSPHost; //Build the REST API request StringBuilder requestUri = new StringBuilder() .Append(spContext.SPHostUrl) .Append("/_api/search/query?querytext='LastName:") .Append(startLetter) .Append("*'&selectproperties='LastName,FirstName,WorkEmail,WorkPhone'&sourceid='B09A7...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-api-usage-sharepoint-add-in
bbe3fa7a4966-7
//Send the REST API request HttpResponseMessage response = await client.SendAsync(request); //Set the response string responseString = await response.Content.ReadAsStringAsync(); The How to build SharePoint add-ins that leverage search (O365 PnP Video) walks you through the EmployeeDirectory (OfficeDev Traini...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-api-usage-sharepoint-add-in
3e5454f35810-0
Use remote event receivers to handle events in the SharePoint Add-in model. Use AppInstalled and AppUninstalling events to set up or remove SharePoint objects and other event receivers your add-in needs. Applies to: add-ins for SharePoint | SharePoint 2013 | SharePoint Online Important As of January 2017 ShareP...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-remote-event-receivers-in-sharepoint
3e5454f35810-1
Complement your change log solution. Using the remote event receiver pattern with a change log pattern provides a more reliable architecture for handling all changes made to SharePoint content databases, site collections, sites, or lists. Remote event receivers run immediately, but because they run on a remote server, ...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-remote-event-receivers-in-sharepoint
3e5454f35810-2
Before you run this add-in, do the following: In the properties on the Core.EventReceivers project, verify that Handle App Installed and Handle App Uninstalling is set to True . Setting Handle App Installed and Handle App Uninstalling to True creates a WCF service that defines the event handler for the...
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/use-remote-event-receivers-in-sharepoint