Tag Info

New answers tagged

1

You can use this code: byte[] contents = ...//your file's byte[] SPAttachmentCollection attachments = item.Attachments; attachments.Add("AttachmentName.txt", contents); Reference


0

No need for custom code required - use SharePoint Designer 2013 ONLY. What you can do is, using SharePoint Designer 2013, create a Workflow that uses the data from a List to create an item in a Library. You create a document library with the same fields as the list, and the workflow creates the item in the document library and passes over the values of the ...


0

You can do it either in IIS or through the webconfig. Excerpt from here IIS Run the IIS Manager Right-click the virtual server that you want to configure, and then click Properties. Click the Web Site tab. Under Connections, type the number of seconds that you want in the Connection time-out box, and then click OK. WebConfig Open the web application ...


0

You should modify your existing webpart and add logic to read the list item id. Then you can form the URL something like http://webapplication/sites/lists/newslist.aspx?ListItemID=57 In the above 57 is the list item id of that particular news. Now edit the newlist.aspx page. Add a webpart which can read the News List where Id the id value present in ...


0

You wrote that your web site is on SharePoint. In the sample code you provided the url "https://mycompany.sharepoint.com/sites/parts/". I assume your SharePoint site is hosted on Office 365. In order to log into Office 365 and SharePoint Online you need to login with special credential object and method. The client object model have a specific class to log ...


0

Actually I found what I was looking for. I just needed to include reference Microsoft.SharePoint.Client and then I could use all client functionalities to query the server's SharePoint list contents.


2

Supriyo's response is exactly what you should pursue if you are working against SharePoint 2013, whether installed locally or on the cloud. This response is to supplement rather than compete with his response. If you are working with older versions of SharePoint (2007 or 2010), you may consider using the SOAP-based services that shipped with those editions. ...


0

You can use IF as below IF(CODE(MID(BOPassword,11,1))<>33,IF(CODE(MID(BOPassword,11,1))<>64,IF(CODE(MID(BOPassword,11,1))<>36,IF(CODE(MID(BOPassword,11,1))<>42,IF(CODE(MID(BOPassword,11,1))<>43,0,1),1),1),1),1) The above will return 1 if position 11 contains any of code 33 or 64 or 36 or 42 or 43 else it return 0


2

The two fundamental ways to access from the client-side in SharePoint is with CSOM (Client Side Object Model) and REST. The links below can help you get started. How to: Complete basic operations using SharePoint 2013 client library code http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx Get started with the SharePoint 2013 REST ...


0

I suggest you to use this code: string strUrl = "http://url"; SPSite siteCollection = newSPSite(strUrl); SPWeb web = siteCollection.OpenWeb();


0

Client Object Model doesn't provide versions property (which is available only on Server Side Object Model) I believe your only hope is to rely on the web services SPservices to retrieve version history of items in SharePoint List 2007?


0

If I understood what you are doing correctly, I don't think that setup will work. The application page isn't actually being loaded to the browser and thus, the link and javascript will not be available to the user. Ideally you should move the web method to a proper web service structure instead of having it hang off of the application page. If you can't do ...


0

I opened the page "CommunitySettings.aspx" I saw in which object references Microsoft.SharePoint.Portal -> CommunitySettingsPage with Reflector and then I saw the internal code. See and use it :) using (SPWeb resource_0 = resource_1.OpenWeb(web.ID)) { resource_0.AllowUnsafeUpdates = true; resource_0.AllProperties[(object) ...


0

Try creating a function and call that the "ScriptManager.RegisterStartupScript". For example: string script = @"<script language='Javascript'>function callAlert(){alert('...');}callAlert();</script>";


0

A search for the same answr brought me to your (old) question. I found the answer and thought i'd share it with you. I code in VB.NET and i converted my code to your C# syntax. Replace your problem area with this code. That should probably do the trick. File pfile = clientContext.Web.GetFileByServerRelativeUrl(xfile); pfile.CheckOut(); ListItem li = ...


0

Instead of PostID you should be updating PostTitle For adding comment you can use below snippet protected void addComment(SPWeb TargetWeb, SPListItem CommentItem, int postID) { SPListItem newCommentItem = Targetweb.Lists["Comments"].Items.Add(); newCommentItem["Created"] = CommentItem["Created"]; newCommentItem["Modified"] = ...


0

Try this XmlElement elShowResult = xDoc.CreateElement("my", "ShowResult", NamespaceManager.LookupNamespace("my")); elNewTestResult.AppendChild(elShowResult); elNewTestResult.InnerText = "true";


0

Following Answer actually sorted my Problem. Thanks to @daver306 Make SharePoint search results link to document instead of DispForm.aspx with no iFilter


1

The way you originally had it using the ItemAdded event was correct. There is just one step missing though - you can make the event run immediately by changing it to run synchronously instead of asynchronously. Details of how to switch the synchronous mode are here: ...


0

I do not know what logic you have in your form that is causing this to happen - a screenshot of data structure and/or the filled out form would help, as would any additional code that applies to this table. However, in InfoPath, you can set Default Data to not include the initial instance of a repeating node. In InfoPath 2013, the option is on the data tab ...


0

My problem was that I was not re-setting the credentials for the new ClientContext, so I just needed to do: newContext.Credentials = credentials; After doing that, it worked fine.


0

Have you tried using the WOPIFrame to help you with it. To do that you probably have to do some custom coding the SP Designer itself. But to understand more on WOPIFrame check out the following URL. https://chrishattonnzlsp.wordpress.com/category/office-web-apps-server-2013/


0

The solution is to move this formula validation from column level to list level. Thus all the columns are present at the list level.


0

in order to interact with the document columns from inside PDF Reader ( assuming adobe ), it must first be saved to the library. when you open the PDF from SharePoint you can then access supported SharePoint integration from the reader file menu, which includes access to document columns. it wont work directly out of the box for PDF because SharePoint ...


0

For uploading file you are use below snippet /// <summary> /// Uploads the specified file to a SharePoint site /// </summary> /// <param name="url">site url</param> /// <param name="creds">Credentials</param> /// <param name="listTitle">List Title</param> /// <param name="fileName">File ...


0

You can try below code : using (SPSite site = new SPSite("Your siteurl")) { using (SPWeb web = site.OpenWeb()) { web.AllowUnsafeUpdates = true; SPList list = web.Lists["Your listName"]; SPListItem item = list.Items.Add(); item["Name"] = txtName.Text; ...


1

You can try like below : SPListItem itemToAdd = list.Items.Add(); itemToAdd["Title"] = "Test Title"; itemToAdd["Description"] = "Test Description"; itemToAdd.Update();


1

Try doing: item.Update() instead of: list.Update()


0

SharePoint UI is built as a Web Application. Web Application are Stateless and that is the reason why controls you are generating dynamically are lost on postback. To eliminate this you should handle the Page_Load event and create the controls. protected void Page_Load(object sender, EventArgs e) { Panel linkPanel = new Panel(); ...



Top 50 recent answers are included