Tag Info

New answers tagged

0

Here's a StackExchange thread on that. The short answer is there is no good solution in 2013. Your options: Use default content type and required fields to prevent documents from being checked in (which you're doing). Use a workflow to email people who haven't provided required information in a timely manner. After detecting that a file is finished ...


2

Evidently this error occurs in case if file has been modified while updating the file: listItem.Update(); ctx.ExecuteQuery(); How about this approach? public static File UploadFile(ClientContext ctx, string sourceFilePath, string targetUrl,IDictionary<string,string> fileProperties) { var targetFileUrl = String.Format("{0}/{1}", targetUrl, ...


0

This should work: // the rest of your code omitted for brevity... uploadFile = documentLibrary.RootFolder.Files.Add(fileInfo); // Update the file metadata uploadFile.ListItemAllFields["ContentTypeId"] = contentTypeId; uploadFile.ListItemAllFields.Update(); clientContext.ExecuteQuery();


0

Rather than using ListItemMenu and ListItemMenuAllowed, try CalloutMenu and CalloutMenuAllowed.


0

An Event Receiver may check if we're running in an HTTP context (HttpContext.Current != null). If so, it may check the URL referer. From that referer, the current View may be checked, and the metadata set accordingly.


0

I have done something like this.. Its works fine . But still i didn't get current version of the file. Means I have a file with versions 1.0, 1.1. but it showing count=1 and showing previous one. 1.0 SPSite site = SPContext.Current.Site; SPWeb web = site.OpenWeb(); //Get the selected document SPListItem listItem = ...


0

Unfortunately only SharePoint Online CSOM API (v.16) supports those properties currently for List object: List.MajorWithMinorVersionsLimit List.MajorVersionLimit In SharePoint On Premise, you could consider the following approach to return those properties: getListInfo('Documents', function (info) { console.log(info.MajorVersionLimit); ...


0

I'm not using Visual Studio, but when working with QuickParts and copying / moving documents between document libraries, the SourceID property on the field must be the same for the quick parts to persist. Try setting this property to something fixes - like the name of your project. Field schema reference at msdn.microsoft.com


1

You can access this information via the MajorVersionLimit and MajorWithMinorVersionsLimit properties of the Microsoft.SharePoint.Client.List object. For example (managed OM): string url = "http://yoursite/subweb"; using (var clientContext = new ClientContext(url)) { var web = clientContext.Web; List list = web.Lists.GetByTitle("YourDocLib"); ...


0

The default view was set to display 1200 items (Must have been altered by someone as the default is 30) I created a new view in SharePoint Designer, made it default and then changed the other one back to 30 items at a time, which solved the issue.


2

I think you need to specify what type of CheckIn you're doing. Such as Item.File.CheckIn("Checked in programatically!", SPCheckinType.MajorCheckIn);


0

Workflows that are set to start on create or on change will start simultaneously. If the workflow is not starting, it is either that 1) the workflow wasn't added to the list, 2) the workflow was added but the trigger isn't correct (not set to start on create / change), or 3) because the workflow is failing on start. If you go to the list (viewed w/ the ...


2

I haven't tried this. But I believe you need to deploy the sandbox solution to your site collection and activate it. Once this is done you can open the folder property and change the content type to Document Set. <- This will work for future folders but not existing ones. The workflow mentioned in the link bellow will do the trick. Also take a look at ...


1

I think you are looking for two storage places correct? Creating a new document library creates a new storage area. This second document library may then be added as a webpart.


0

Typically developers don't clean up after themselves on feature deactivation as this can lead to a loss of data. Even Microsoft doesn't clean up after themselves when disabling Publishing features. If there are instances of the lists and libraries remaining, they should be deleted from the site(s) and those errors should go away.


0

Instead of using SPFile object use the SPListItem in foreach loop. And within the loop we can use the File property of SPListItem to get the SPFile object. Try the below code... foreach (SPListItem item in items){ SPFile file = item.File; if(docmanager.getFileExtension(item) == ".pdf"){ if (file.LockId != null){ ...


0

We had the very same issue in case of a user, who had permissions only on the document library, but not on the web site. Solution was to inactivate the "Limited-access user permission lockdown mode" site collection feature.


1

SPListItemCollection is a collection of SPListItem. Get File object from SPListItem. Example: foreach (SPListItem item in items) { SPFile file = item.File; }


0

Do you mean that you want to display the Path managed property? That would be pretty easy since it is already being presented as the link to the document. Just modify the Display Template and surface the Path as text.


0

You can remove the feature from Content Database, and then try upgrading Remove-SPFeatureFromContentDB -ContentDB "WSS_Content_Communities" -FeatureId "a5b72e0e-edbd-458d-8957-16f4653b5060"


0

Please, see my answer in this thread. As far as I the official documentation of this API, and other samples on the web (like this and this one) understand, the body of the request can be set in this case as a StringEntity instance via the setEntity method of the HttpPost object: String jsonString = "{ '__metadata': { 'type': 'SP.List' }, ...


1

I assume you mean SharePoint 2013. In this case, of course, you can create lists, including document libraries via REST, as described here. For the document library you should use 101 as the BaseTemplate. url: http://site url/_api/web/lists method: POST body: { '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 101, ...


1

How to create a Document library using SharePoint REST: url: http://site url/_api/web/lists method: POST body: { '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 101, 'ContentTypesEnabled': true, 'Description': 'My Documents Library', 'Title': 'Documents' } Headers: Authorization: "Bearer " + accessToken ...


0

You can refer to below link to get info on Approval Work Flows: Understand approval workflows in SharePoint 2010


1

The Document Approval workflow routes a document to a group of people for approval. The approval stage can be serial or parallel meaning approvers can do review in serial order (one at a time) or in a parallel order (all at once). Document Approval Workflows are created using out of the box workflow "Approval - SharePoint 2010" or can also be created as a ...


1

try below code: Add-PSSnapin Microsoft.SharePoint.PowerShell # Replace siteurl with actual web url $web = Get-SPWeb -Identity "siteurl" # Replace docurl with document library url $list = $web.GetList("docurl") function DeleteFiles { param($folderUrl) $folder = $web.GetFolder($folderUrl) foreach ($file in $folder.Files) { # Delete file by deleting ...


1

You can use just a small trick as mentioned below. Sample Code : foreach (SPListItem item in list.Items) { foreach (SPListItemVersion itemVersion in item.Versions) { if (item.File.Versions.GetVersionFromLabel(itemVersion.VersionLabel) != null) { ...


1

You can split the version label and check is the second part 0 string[] versionArray = itemVersion .VersionLabel.Split('.'); int minorVersion = Convert.ToInt32(versionArray[1]); if (minorVersion == 0) { //this is a major version } or you can check the reminder when dividing VersionId with 512 int modulo = itemVersion.VersionId % 512; if (modulo == 0) ...


0

Not sure if you're using 2010 or 2013, but here are a couple of CAML queries you should be able to use for either: 1.) How to write a caml query that filters by .pdf or folders? 2.) https://rmanimaran.wordpress.com/2010/10/19/getfind-all-checked-out-documents-from-a-document-library-using-caml/ Here is some SharePoint 2013 app sample code which gets all pdf ...


0

You can do this by modifying the list view xslt. Another option is to add a calculated field and use below formula =TEXT(Created, "dd-mmm-yyyy HH:MM:SS")


0

Ok.. success ! In case someone else is struggling here is the script. General Works in MDS and non MDS mode if deployed as per script comments. An old method of hiding the column using jQuery is included but commented out (ie. the OnPostRender has been commented). I thought it might be useful to someone. I have not done extensive testing yet so mileage ...


0

While you cannot get the list TITLE this way, you should at least be able to get the list URL through a somewhat round-a-bout way. It will require two new columns on your content type and a new step in the workflow: Create a new site column (single line of text) and call it "Path" Add the new "Path" column to your content type In your reusable workflow, ...


0

If you're developing the workflow in Visual Studio, you can use the following code to access the Title property of the Item's Parent List. // Get the item the workflow is running on. SPListItem item = workflowProperties.Item; // Get it's parent list/library title. string libraryTitle = item.ParentList.Title.ToString(); // Set the column value. ...


1

You can use PowerShell scripting for this Sample code $spWeb = Get-SPWeb http://siteurl $spList = $spWeb.GetListFromUrl("/Lists/ListName/AllItems.aspx") $spField = $spList.Fields["Field Name"] $spField.DefaultValue = "1;#Term Name" #1 is term ID $spField.Update()


0

The recommended method is to create content types for each template. https://support.office.com/en-za/article/Add-multiple-Office-templates-to-a-document-library-cde94e90-a1ba-4b94-a187-600ed68562bb Need Word Template to create new doc (not to checkout, not to edit existing - just create new in MS-Word


0

The example demonstrates how to specify list item properties (Content Type in this case) while uploading the file: var targetList = context.Web.Lists.GetByTitle(listTitle); var fileInfo = new FileCreationInformation() { Content = fileContent, Overwrite = true, Url = fileUrl }; var uploadFile = ...


0

I'd do this through a quick workflow. Set the workflow to fire on document change, and set the workflow to change your column to the default value. Once you've got the workflow published, create a new temporary column and populate it in datasheet/quick edit view just to trigger the workflow (and thereby changing your default value). Once it has all ...


0

I played around with this for a few additional hours to try to see if there was some other property I could check on in the AfterProperties collection and there wasn't. However the properties object in the ItemUpdating method does have 2 other properties - BeforeUrl and AfterUrl which contain the old and the new value of Name (aka. FileLeafRef) By ...


1

Users may set alerts to the list with the setting to notify them on change of their documents. Alternatively use a list workflow. A list workflow requires no action from the user as it applies to all items in the list. It can be designed using Sharepoint designer 2010 in a few clicks. Example In SPD use the workflow action for mail to send an email. In ...


0

Did you try downloading the form and publish it again to SharePoint?


1

Cannot test this, but would using CredentialsProvider help, assuming you're using NTLM authentication. public void createFolder(String digest) throws ClientProtocolException, IOException { HttpPost request = new HttpPost( "http://industrial-ex/sites/tifdemo/_api/Web/Folders/add('enovia/newfolder')"); request.addHeader("Content-Type", ...


0

If John has “Read” permission level to a document named sales.docx, John is able to search and find this document and view it either in Office Web App on the server (in the browser), or in Office client on his computer. If John has “View Only” permission level to sales.docx, John can browse to the document library and see the document, however John cannot ...


0

If I'm understanding correctly, you could just create a manual workflow that will copy the pdf or items to each site.


0

I finally found a solution which copy the document for me. $.ajax({ url: currentSiteUrl + "/_api/web/getfilebyserverrelativeurl('" + sourceFileRef + "')/$value", type: "GET", headers: { "Accept": "application/json;odata=verbose" }, binaryStringResponseBody: true }).done(function (result) { ...


2

These are the limits imposed by SharePoint which we can't override. Character limit for files and folders These limits apply to files and folders that you add to a synced library folder for uploading to SharePoint. In SharePoint Server 2013, file names can have up to 128 characters. In SharePoint Online, file names can have up to 256 ...


2

You can use Audit Feature of SharePoint for the same: Configure audit settings for a site collection On the site collection home page, click Site actions, point to Site settings, and then click Modify All Site Settings. On the Site Settings page, in the Site Collection Administration section, click Site collection audit settings. Select the events you ...


0

I think creating folder is the best option. In future if organization change happens it will be easier to move. You can break inheritance and give unique permissions to folder. I don't see any downside for using folders in this use case.



Top 50 recent answers are included