SharePoint 2013 Hosting News – How to Print only the user Created fields in SharePoint using JavaScript?
In this lovely day, We will discussed about How to Print only the user Created fields in SharePoint 2013 using JavaScript. …
In this lovely day, We will discussed about How to Print only the user Created fields in SharePoint 2013 using JavaScript. …
Hi, today I will talk about Connect CRM to SharePoint via SDK. And then write the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; using Microsoft.Crm.Sdk.Messages; using SP = Microsoft.SharePoint.Client; using Microsoft.SharePoint.Client; using System.Security; public class CreateSharepointFolder: IPlugin { static SharePointOnlineCredentials creds; static string SharepointsiteURL = “”; static string SharepointUsername = “”; static string Sharepointpassword = “”; public CreateSharepointFolder(string unsecureConfig, string secureConfig) { if (string.IsNullOrEmpty(unsecureConfig)) throw new InvalidPluginExecutionException(“Unsecure configuration missing.”); else { SharepointsiteURL = unsecureConfig; string[] splitt = secureConfig.Split(new char[] {‘;’ }); SharepointUsername = secureConfig[0].ToString(); Sharepointpassword = secureConfig[1].ToString(); } } public void Execute(IServiceProvider serviceProvider) { IPluginExecutionContext context = (IPluginExecutionContext) serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory factory = (IOrganizationServiceFactory) serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = factory.CreateOrganizationService(context.UserId); //Create connection to sharepoint site creds = GetSharepointCredentials(); try { // The InputParameters collection contains all the data passed in the message request. if (context.InputParameters.Contains(“Target”) && context.InputParameters[“Target”] is Entity) { Entity entity = (Entity) context.InputParameters[“Target”]; if (context.MessageName == “Create” && context.PrimaryEntityName == “new_entity”) { //Entity folder name in sharepoint site string entityDisplayName = “Test Entity”; //Folder name for new record string RecordFolderName = entity.Attributes[“new_name”].ToString() + “_” + entity.Id.ToString().Replace(“ {“, “”).Replace(“ }”, “”).Replace(“ - “, “”).ToUpper(); //Create entity main folder CreateFolder(SharepointsiteURL, entityDisplayName, context.PrimaryEntityName.ToString(), RecordFolderName, “”, creds); //Create child folder CreateFolder(SharepointsiteURL, entityDisplayName, context.PrimaryEntityName.ToString(), RecordFolderName, “Images”, creds); } } } catch (Exception ex) { throw new InvalidPluginExecutionException(ex.Message.ToString()); } } public SharePointOnlineCredentials GetSharepointCredentials() { if (creds == null) { SecureString securePassword = new SecureString(); for (int i = 0; i < Sharepointpassword.Length; i++) securePassword.AppendChar(Sharepointpassword[i]); creds = new SharePointOnlineCredentials(SharepointUsername, securePassword); } return creds; } public void CreateFolder(string siteUrl, string listName, string folderlogicalName, string newfolderName, string relativePath, SharePointOnlineCredentials cred) { using(ClientContext clientContext = new ClientContext(siteUrl)) { clientContext.Credentials = creds; Web web = clientContext.Web; SP.List list = web.Lists.GetByTitle(listName); ListItemCreationInformation newItem = new ListItemCreationInformation(); newItem.UnderlyingObjectType = FileSystemObjectType.Folder; newItem.FolderUrl = siteUrl + folderlogicalName; if (!relativePath.Equals(string.Empty)) newItem.FolderUrl += “ / ” + relativePath; newItem.LeafName = newfolderName; SP.ListItem item = list.AddItem(newItem); item.Update(); clientContext.ExecuteQuery(); } } } |
SharePoint 2013 …
Today, I will tell you about Checkin the Page in SharePoint 2013 using Javascript. After the Success of the check …
In this short article, I will explain you about how to delete list and Libraries using PowerShell Script for SharePoint …
In this post, let me explain you about getting the count of sites followed by the user in SharePoint 2013. …
In this post, let me tell you How to get the list of sites under a Wen Application using Powershell …
This tutorial, I will show you how to use a PowerShell script to check if a custom feature requires an …
Would you ever have liked to discover the greater part of the sections of a certain sort in SharePoint? All …
In this post, I will tell you about export SharePoint User Profiles to CSV Using SharePoint Powershell. You may have …
Today, I will explain you about How to Add Permission Levels Using Powershell in SharePoint 2013.Besides using PowerShell to switch …