Monthly archives: June, 2017

How to loop through all WebParts controls

There is a way I loop through all controls of my Sharepoint 2013 Visual WebPart, and only them? Something like this: … foreach(var _control in this.Controls) { if (_control.typeof() == ) _control.Text = GetTranslation(_control.Text); if (_control.typeof() == ) _control.InnerText = GetTranslation(_control.InnerText); } … As you can see, we need to translate all text in a …

Exporting a sub site from sharepoint 2010 to sharepoint 2013

On doing the Import-SPWeb command I am getting this error: FatalError: The required attribute ‘FeatureDefinitionScope’ is missing. Please point me to the problem here? ================= ================= 2 Answers 2 ================= Their is no direct way(OOTB) to export a site from 2010 and import into 2013. But with little effort you can do it. their are …

Restoring a site in the same farm but different managed path

I need to restore a site “Sales” within same web application. Here is what I did? Created a backup of “Sales_DB” using sql management studio. intra.df.suz/Sales Created a new database “Sales_US” using sql mgmt studio Created a managed path “SalesUS” with explicit Ran stsadm -o addcontentdb but it gives following error intra.df.suz/SalesUS The attach operation …

Get File Url from a Lookup Column REST API

I have a lookup column that correlates to a background image in my presentation layer. Is it possible to expose the URL to the actual file via the $expand mechanism using REST? Example REST URI my.sharepoint.com/_api/web/lists/getbytitle('Documents‘)/items?$select=Title,FileRef,Document_x0020_Image/ServerRelativeUrl&$expand=Document_x0020_Image If I do a separate REST call to the actual Document Image list there are a couple properties that …

js link group count list SharePoint 2013

(function () { var itemCtx = {}; itemCtx.Templates = {}; itemCtx.Templates.Group = GroupOverride; SPClientTemplates.TemplateManager.RegisterTemplateOverrides(itemCtx); })(); function GroupOverride(Ctx, group, groupId, listItem, listSchema, level, expand) { return ‘ ‘ + listItem[group] + ‘ ::’ + ‘ ‘+ listItem[group].Count + ‘ ‘ + ‘ ‘; } I have a list column name “category” and have values like Completed, …

GetUserEffectivePermissions returns wrong results

I’m checking the permissions for user on a SharePoint 2013 list: using (var ctx = new ClientContext(“comtoso.com”)) { var list = ctx.Web.Lists.GetByTitle(“TestList”); ctx.Load(list); ctx.ExecuteQuery(); var permissions = list.GetUserEffectivePermissions(@”domain\username”); ctx.ExecuteQuery(); foreach (var permission in Enum.GetValues(typeof(PermissionKind)).Cast()) { var permissionName = Enum.GetName(typeof(PermissionKind), permission); var hasPermission = permissions.Value.Has(permission); Debug.WriteLine(“Permission: {0}, HasPermission: {1}”, permissionName, hasPermission); } } which returns following …

Workflow Suspended at Email

My SharePoint 2013 workflow keeps suspending itself at the point it’s supposed to send an email. The email details have been specified in Central Admin but it’s still not working. When the workflow is supposed to send an email out (internally) it suspends with an error. Here is the information that is given about the …