Tag Info

New answers tagged

1

If the Issue Status field does not meet your requirement you should not use it and use a custom column instead. If you envision this list being used in multiple places and across site collections I'd suggest using a Managed Metadata field, because once your users start using it they will find they need additional choices.


0

It seems like an issue with your Content Type. Check fields and make sure none of them has Indexing enabled. http://www.entwicklungsgedanken.de/2008/07/20/cannot-complete-this-action-error-when-adding-a-contenttype-to-a-list/


0

Or you can just add disable-output-escaping="yes" to the xsl value in itemstyle.xsl to get the html to render correctly. For example: xsl:value-of select="substring(@Description,1,255)" disable-output-escaping="yes" /> OUTPUT ESCAPING RICH TEXT IN A CONTENT QUERY WEB PART


0

You can edit the XSLT and remove html using below template <xsl:template name="RemoveHtml"> <xsl:param name="String"/> <xsl:choose> <xsl:when test="contains($String, '&lt;')"> <xsl:value-of select="substring-before($String, '&lt;')"/> <xsl:call-template name="RemoveHtml"> ...


0

You can create an SPSite Object using URL using(SPSite site = new SPSite("http://intranet/staffdirectory")) { using(SPWeb web = site.OpenWeb()) { SPList list = web.Lists["SiteAssets"]; SPListItems items = list.Items; foreach(SPListItem item in items) { //Logic to rename file item.File.CheckOut(); ...


0

Try Context.Response.Clear() before writing anything to it. This would ensure that ONLY your javascript is in the response. otherwise you could deliver a malformed html-page.


0

In the options add dialogReturnValueCallback: DialogCallback and add the callback function where you refresh the page when you want. The complete code: var options = { url: _spPageContextInfo.webAbsoluteUrl + '/_layouts/15/xx/Pages/Page.aspx', tite: 'Edit Properties', allowMaximize: false, showClose: true, width: 800, height: 600, ...


1

If the user who you are Sharing File is part of SharePoint then you can simply pass the URL to the user, who can access the file directly. For external users, you can get this link using ObjectSharingInformation class. This class has property AnonymousEditLink and AnonymousViewLink You can use below snippet for that var item = //code to get list item.. ...


1

If you have the privileges to do so, make a change in the system registry. [HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\InfoPath\Designer\RestrictedFeatures] "CodeAllowed"=dword:00000001 Restart InfoPath and the Programming option should be available from the Tools menu.


1

You can create a custom permission level that does not allow deleting. You'd essentially copy contribute and deselect the delete option. This solves point 1. For point 2, there isn't really anything that handles this. Item level security settings on lists comes close, but it isn't fully what you need and isn't available in libraries. You'd probably need to ...


0

If you have access to the reporting database, the URL is in a field named "ProjectWorkspaceInternalHRef" in the Project table. The same field is also available via REST. Though, basic information about Risks are already in the reporting database in a table named MSP_WSSRisk, so you don't need to do extra work for those. (If any custom columns were added, ...


0

Well, if you have identified the files you need, why not just copying them as byte Arrays ? Just call the following method with the full file URL public static byte[] GetBytesFromFile(string fullFilePath) { FileStream fs = System.IO.File.OpenRead(fullFilePath); try { byte[] bytes = new byte[fs.Length]; fs.Read(bytes, 0, ...


0

We can get the Checked out files using the below code. No matter what you try, you cannot get the checked out files by querying the document library as these are saved in a separate table in the database. SPDocumentLibrary library = (SPDocumentLibrary)list; IList<SPCheckedOutFile> files = library.CheckedOutFiles; foreach (SPCheckedOutFile file in ...


0

You can use ResolvePrincipal method for retrieving user based on email address ClientResult<Microsoft.SharePoint.Client.Utilities.PrincipalInfo> persons = Microsoft.SharePoint.Client.Utilities.Utility.ResolvePrincipal(clientContext, clientContext.Web, "mymail@tenant.onmicrosoft.com", Microsoft.SharePoint.Client.Utilities.PrincipalType.User, ...


0

OK. It seems that Sparqube Lookup Classic uses the file title and cannot work with files that have no title. So, first you have to set the title and then everything works: public static void PublishDocToSP() { var clientContext = GetClient(); SP.Client.File file; var folderName = "DocLib"; // Upload file { ...


1

It really depends on the type of content we’re discussing. If this is a project web where team members only have access, and company guidelines don’t restrict the use of task list in a way that it should be retrievable in reports you could let go and allow users to build their own task statuses. But if you have project webs that are managed in the same way ...


0

The above case will not arise if the initial analysis (Which normally gathers during Governance & Information Architecture Planning) was done properly. If you are planning to manage the Categories centrally then you should get all information which can go into that field and insert it into the Top Level. This approach will only work in case everyone ...


0

I unfortunately couldn't get any of the above working, so I used an ugly hack: public static List GetListByUrl(ClientContext context, string listUrl) { List result = null; ListCollection lists = context.Web.Lists; context.Load(lists, all => all.Include(l => l.RootFolder)); ...


0

It is part of Client Side Object Model. If you are looking to get selected items in Server Side. Then you need to handle this in client side and then pass information using say a hidden input field. For more refer this thread ...


2

If you have custom security definitions defined inside your source site, they will not be retained in the template as they cannot be expressed using the declarative language the template uses internally. Your only option really is whether or not to inherit from parent at site creation, as Ransher suggested above. You'll need to manually recreate the ...


0

SPContext.Current.ContextPageInfo.IsWebWelcomePage


2

attempting to answer your questions specifically when adding a new column, you'll want to add it to the parent if you want the parent and subsequent children to have the same column. If your parent is an OOTB SharePoint CT, then only add it to your child. I don't recommend modifying SharePoint content types, you never know what Microsoft might do, plus ...


1

The hierarchical relationship allows you to reuse the settings (fields) defined in one content type (parent) in other (child) content types. The hierarchy of content types can be extended to an infinite width and depth, but the best practice is to use 3-level parent-child hierarchy. You could read more best practices on how to manage content types and ...


3

When working with parent/child content types, I do this: The parent has only the fields that will exist in all child content types. Then each child content type only has the fields in it that are needed and are not inherited from the parent. So if your children each have different priority values, then each one would have their own priority field that is ...


0

You could consider at least two options: retrieve an additional user properties from User Information List retrieve user properties via User Profile Option 1 var userInfoList = site.RootWeb.SiteUserInfoList; var userInfoItem = userInfoList.GetItemById(user.ID); var pictureUrl = userInfoItem["Picture"]; var workPhone = userInfoItem["WorkPhone"]; Option ...


0

You can read Photo Url using User Profile Service API. using (SPSite site = new SPSite("http://siteurl")) { SPServiceContext context = SPServiceContext.GetContext(site); UserProfileManager profileManager = new UserProfileManager(context); UserProfile currentProfile = profileManager.GetUserProfile(user.LoginName); ProfileValueCollectionBase ...


0

You can look at the User Information List, to grab the Picture column contents. It's a hidden field, so you might have to write a console app to get the columns, or find a reference somewhere online. Tobias Zimmergren did a blog post on getting user data from the User Information List from an SPUser object: ...


1

The following class could be introduced for that purpose that implements Enumerable Interface: class UserProfileTypedManager : UserProfileManager, IEnumerable<ProfileBase> { public UserProfileTypedManager(SPServiceContext serviceContext) : base(serviceContext) { } public new IEnumerator<ProfileBase> GetEnumerator() { ...


0

You can try like this: var serviceContext = SPServiceContext.GetContext(site); var userProfileManager = new UserProfileManager(serviceContext); foreach (UserProfile userProfile in userProfileManager) { // ... } You will need elevated privileges to perform this operation


4

You can use below code to extract the SPUser object string valueField2 = item[fieldID2].ToString(); SPFieldUserValue userField = (SPFieldUserValue)item.Fields[fieldID2].GetFieldValue(valueField2); SPUser user= userField.User; Now you can access all properties of SPUser Object Example user.LoginName


0

I have been using below function in multiple projects and it works well. private static bool AlterTask(SPListItem task, bool fSynchronous, string param) { int attempts = 5; int millisecondsTimeout = 100; Hashtable htData = new Hashtable(); htData[SPBuiltInFieldId.Completed] = "TRUE"; htData["Completed"] = "TRUE"; ...


3

You don't need to install SharePoint locally for Office 365 app development. Following are packages you should install along with Visual Studio 2012 Office Developer Tools for Visual Studio 2012 SharePoint Client Components Windows Identity Foundation SDK Windows Identity Foundation Extensions Workflow Tools SDK and Workflow Client SDK Check this ...


2

You can't compare Reference objects unless they implement IEquatable interface. Or it should override equal method with custom implementation. I would suggest you compare SPUser.LoginName instead.


0

Approving a task or similar actions in theory means you are updating a list item. And each list item has a unique ID, and it can be easily retrieved in a SharePoint workflow. From your question, I understand you have 3 requirements 1. Send an email from a workflow. Which is pretty simple just insert an action Send an Email from ribbon 2. To get the ...


2

It may happen as they are configured within an Active Directory group, instead of web.SiteUsers try using web.Users , to understand the difference you can check this link You can also get Users from User Profile Service as you said you get right result from the service var serviceContext = SPServiceContext.GetContext(site); var userProfileManager = new ...


0

If code is running too long the asp.net feature activation could be terminated. Try to edit web.config in 14 hive < location path="_layouts/ManageFeatures.aspx" > < system.web > < httpRuntime executionTimeout="3600" / > < /system.web> < /location > I just set the time for one hour it's should be enough.


2

One workaround is: Enable the Publishing feature at site collection now browse this page sitecolelction/_layouts/15ChangeSiteMasterPage.aspx Now you can change the master page for all subsite.


1

If you change anything in Site Template after you have created the sites using that template. Then you need to manually update the changes in each of the sites you created. Because there is no way to do this. You need to make sure all the changes are added on the site template first and then you need to create the sites accordingly. Refer this article for ...


1

There is default SharePoint CSS class available that you can use. ms-dialogHidden is the class when you don't want particular div or any element to appear on the dialog. So simply specify extra class to the navigation div ms-dialogHidden.


2

You will need to add new column "Issue ID" in your list. Then you can use SharePoint designer workflow or event receiver to create this unique string and to update in "Issue ID" column. Steps: Create a column "Issue ID" in your Task List Now go to SharePoint Designer, Create a workflow for task list and set it to run automatically when Item is added Now ...


0

I had to convert a possible Claims Authentication name format back to DOMAIN\USER format to run EnsureUser. Seems EnsureUser will work with the claims format for existing users that have accessed the site, but not new users. This code sample gets the email address for a user by first checking if the provided name is in claim format and converts it to ...


4

For those who are still looking for the answer. SharePoint 2013 (since SP1 at least see UPD below) contains special method Web.GetList. It accepts site-relative url for the list, i.e. site/dev/lists/mylist. Sample code for .NET object model: var ctx = new ClientContext("http://sp2013dev/sites/dev"); var list = ...


0

The easiest is to save the list as a template with content and download the file, re-upload it as a template in the new destination


2

In SharePoint you can configure the outgoing email settings at two locations in the Central Admin. First, there is a global setting at Central Admin -> System Settings -> Configure outgoing e-mail settings (that is what was asked in the original question). Second, you can configure an alternative setting for each of the web applications at Central ...


0

You can follow a different approach .Rather than specifying list id or name in ELement.xml you can specify same thing in the code public override void ItemDeleting(SPItemEventProperties properties) { if(properties.ListItem.Title="Name of your list") { using (SPWeb web = properties.OpenWeb()) { try { ...


0

There are many reasons why an EventReceiver would not fire. According to my experience, one of the sneakiest reasons is that you are using a dll from another project, but, from the same solution. And if you didn't add the assembly for when the solution is deployed the EventReceiver using it would not fire because the dll would not load. If you haven't tried ...


0

I've noticed that setting LookupList and LookupWebId does not always work. Therefor, I have a function that replaces XML attributes in field's schema. Take a look at the following code: public static string ReplaceXmlAttributeValue(string xml, string attributeName, string value) { if (string.IsNullOrEmpty(xml)) { throw new ...


0

You have several options to achieve this: Create a custom action with server-side control. You can create a ribbon custom action, add it to list and handle the code in your code behind. Here is the sample of such custom action. Create a custom action with JavaScript using JQuery AJAX call to HTTP endpoint, that executes your C# code. Here is the sample ...


0

private SPListItem CopyItem(SPListItem sourceItem, string destinationListName) { //Copy sourceItem to destinationList SPList destinationList = sourceItem.Web.Lists[destinationListName]; SPListItem targetItem = destinationList.Items.Add(); foreach (SPField f in sourceItem.Fields) { //Copy all except attachments. if ...


0

I think, there is no problem using your suggested approach. That can be useful when you are working on some static kind of stuffs. I usually prefer this kind of approach, when static content is there. Thing you need to remember is that in case you are upgrading your SharePoint with cumulative update, there might be a chance that that wiki page will get ...



Top 50 recent answers are included