Tag Info

New answers tagged

2

Use query.ViewAttributes = "Scope=\"Recursive\"";


1

The problem is probably that SPRoleAssignment is using the ID of the passed in oUser, but the user with that ID in http://<<server>>/websites/gwp/ is very unlikely to be the same user as the one with that ID in SPContext.Current.Web unless SPContext.Current.Web is http://<<server>>/websites/gwp/. So you need to change ...


0

fine-grained permissions is when you break this inheritance for any securable object that is at a lower level in the hierarchy by editing the permissions (creating a unique permission assignment) on that securable object. We recommend that you use fine-grained permissions only when a business case justifies it. Fine-grained permissions can increase the ...


1

Here is the official SharePoint Limits and Boundaries https://technet.microsoft.com/en-us/library/cc262787.aspx#ListLibrary From this we can make few assumptions and calculate number of libraries per Site Collection ~ 2 Million maximum theoretical or practical number of libraries in a site collection


0

Fine-grained permissions can influence security on a SharePoint farm. Potential performance issues can occur when you use fine-grained permissions. Assign permissions at the highest possible level (Folder instead of documents). As part of this strategy, consider the following techniques: Put documents that require fine-grained permissions in document ...


0

Once you enable versioning, every changes create a new version. You can decide version numbering. And decide Major/Minor versions. You can use Version History to restore or download previous version of the document. You can enable content approval. In this case only Published and Approved documents will gets added to the versions as opposed to every minor ...


0

It goes based off of just major versions, (optionally) drafts of major versions and only starts from the point where you turn on versioning. If you have been editing a document all along and then turn on versioning, the first version to be saved is the one that was published when versioning was turned on. If you want something other than that, you'll have ...


1

You can use PowerShell as below $site = get-spsite http://sitecollectionurl foreach($web in $site.AllWebs) { $libraryName = "DocumentLibrary" $list = $web.Lists[$libraryName] if($list) { #logic to update the library; like modifying field information etc. } }


0

There is no Straight forward way to do this. Even if the document resides in Document Library. One way is to read the document into memory and convert it to web page (html) and load it into a div or panel http://www.aspsnippets.com/Articles/Convert-Office-Word-Document-to-HTML-and-display-it-in-browser-in-ASP.Net.aspx ...


0

Did you create a column or a content type in the content type hub? If it is a column, did you add it to the Document Library content type? If that is the case, you can either wait for propagation of the change or you can choose Republish option under Content type>>Manage publishing for this content type If you have created a new content type, that content ...


-1

You have to make sure the following things in order to open the PDF in browser. There are two options available Browser File Handling should permissive for the web app, you can change it using the Central Admin > Manage web Application> Web Application General Settings. this is kind of security risk. Explicitly add PDF to allowable list of MIME types in ...


1

Using JavaScript you can get ID using var list; ExecuteOrDelayUntilScriptLoaded(Start, "sp.js"); function Start() { var currentcontext = new SP.ClientContext.get_current(); list = currentcontext.get_web().get_lists().getByTitle('ListTitle'); currentcontext.load(list, 'Id'); currentcontext.executeQueryAsync(Function.createDelegate(this, ...


1

I think that depends a lot on how your project is structured and your deployment process. In scenarios like this, I use feature activation code to provision my document library with a GUID generated by the Visual Studio tool. Then in my code I reference this GUID where necessary. Then once the feature is packaged, deployed, and activated, it is consistent ...


0

I did another search and found a question that was similar to mine labeled: Automatically add attachment to new list item After playing with the code, I was able to get mine working. First, create the function to get the current list and current item in order to find the attachment as the file object. The getUrlParameter("ID") is a short little function ...


6

You have to break permission inheritance on each document that you want to protect. Go to the document library, select the options menu (...) and the additional options (...) and select Advanced > Shared with. On that view select advanced and click on the ribbon button "Stop inheriting permissions". Add the group/users who should have access to the ...


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

FolderPath = "http://YOUR-SharePoint-Site/sites/sales/documents/Invoices"; SPFolder TargetFolder = SPContext.Current.Web.GetFolder(FolderPath); Target.Item["Name"] = "Invoices 2014"; Target.Item.Update(); Read more: Here `


1

Pretty sure that if the newest version is a minor version, that will not be deleted when using that. You could try creating a new major version (it would be the newest version, then "delete minor versions", which should remove all minor versions). I just tested the above scenario and this worked for me.


1

As Michael says above, a default value only occurs at default, it doesn't change values if one exists. Can you use a SPD workflow to change the value? How are you moving the document? I would imagine that at the worst, you could setup a workflow to run on update and if the value of the field you are looking at is 0815, change it to 999. No update would ...


0

Sorry, but: NO In the end libraries are lists too, just "better ones" which Support files, but in the end they have the same functionality (Columns, Rights, ...). No way to remove their permission to add a document libray (at least in Office 365). All you could do is to hide the button using JavaScript (as mentioned above), but after all, the user is still ...


0

Since its SharePoint Online we don't have much option. Ideal solution is to update the Site Templates and remove it from there. To tackle this you can add following JavaScript code into <script type="text/javascript"> function AlterStorefront() { if (SP.Storefront != undefined) { var listedApps = ...


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

As per SharePoint best practices, Any update directly to the database is not going to a viable solution and supported. so use only the object model or CSOM or the supported way for this.


1

You can use PowerShell to get this information Function GetFiles($folder) { Write-Host $folder.Name foreach($file in $folder.Files) { Write-Host $file.Name } foreach ($subFolder in $folder.SubFolders) { GetFiles($Subfolder) } } $web = Get-SPWeb http://weburl $list = $web.Lists["ListName"] ...


0

Yes you can do that with the help of WSP solution. You need to create XML based Custom action for all the document library type. Refer below examples for creating custom actions: Custom actions in SharePoint 2013 Creating SharePoint Ribbon Custom Actions with Visual Studio 2012 How to Add Custom Ribbon Action on List/Libraries in SharePoint 2013 How ...


0

public void Main() { using (var clientContext = new ClientContext(@"https://microsoft.sharepoint.com/teams/PAF/")) { var passWord = new System.Security.SecureString(); foreach (char c in "NextGenReport@2014".ToCharArray()) passWord.AppendChar(c); clientContext.Credentials = new ...


0

I tried this in our SharePoint 2010 farm and found the same problem.But one more thing i noticed. If you click on the Edit properties of the a slide, now you can see the ratings column here. this is sort of workaround.


1

If you are using SharePoint on-premises you can't create the library and the custom columns in a single call using the REST API. You need to make a call to create the library and then make subsequent calls to create each of the custom columns. The REST API in SharePoint Online now supports batching so you can create the library and the custom columns in a ...


1

I don't think you can create fields (columns) in a list/library at the same time when creating it as the REST endpoints for list/library and fields are different. So you will have to first create your document library and then add fields to it. The Fields REST API reference on MSDN is a pretty comprehensive guide on how to create different type of fields. ...


1

I'm not sure if a column can be created at the same time, but perhaps this example will guide you on how to create a column: // Create a new list field function createField() { var fieldName = document.getElementById("createlistfieldname").value; var executor; // Initialize the RequestExecutor with the app web URL. executor = new ...


0

UserAgent not available, file operations may not be optimized. at Microsoft.SharePoint.SPFileStreamManager.CreateCobaltStreamContainer(SPFileStreamStore spfs, ILockBytes ilb, Boolean copyOnFirstWrite, Boolean disposeIlb) at Microsoft.SharePoint.SPFileStreamManager.SetInputLockBytes(SPFileInfo& fileInfo, SqlSession session, PrefetchResult ...


0

05/11/2015 11:13:19.95* w3wp.exe (WSP1010:0x1FC8) 0x0780 SharePoint Foundation Files ak8dj High ...stContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at ...


0

> Timestamp Process 05/11/2015 11:13:19.92 w3wp.exe (WSP1010:0x1FC8) 0x0780 SharePoint Foundation Logging Correlation Data xmnv Medium Site=/sites/localpmo 665b059d-87e2-709b-7964-a85b05d10a36 05/11/2015 11:13:19.95 w3wp.exe (WSP1010:0x1FC8) 0x0780 ...


0

There is no hard limit for doc libraries, there is rather a limit for 60.000.000 items per content database: https://technet.microsoft.com/en-us/library/cc262787.aspx#ContentDB "The largest number of items per content database that has been tested on SharePoint Server 2013 is 60 million items, including documents and list items. If you plan to store more ...


1

You can configure Incoming Email for the document library where you want to save the documents, once you configured the incoming email you can send mail to list so that it will save attachments to list. Follow steps here to configure Incoming email for your farm and to configure settings for library


0

Thanks for commenting. Later i figure out that, the document i was trying to upload has some weird characters other than special characters in file properties attributes. So after removing those characters, it is working fine.


0

This issue is typically for couple of reason. If for some reason the App Pool Account dont have the correct permission on the Content DB( DBO permission required). May be your Content DB is marked as Read-Only at SQL Server. also try to upload the file on the same library see if that succeeded. Also check if the quote of site not completed. Lastly run ...


1

If you have the excel Service enabled then this problem is most probably with ASP.NET Impersonation. Solution: Disable the ASP.NET Impersonation at the Server level and "SharePoint Web Services" level. Via: IIS > Authentication > ASP.NET Impersonation -- Microsoft Knowledgebase entry IF no ECS configured in the farm then check this


0

According to this blog: http://nickheylen.com/2014/05/15/sync-error-we-cant-connect-to-the-specified-sharepoint-site/ You must either give the following persmission: Use remote interfaces Use Client Integrations features Open or If you disable the ‘Limited-access user permission lockdown mode’ feature via ‘Manage Site Collection Features’ at the ...


3

Is this behavior for all users or only few and what about browser? In the real world scenario it should work, just make sure the Enable Client Integration at web app level. Central Administration > Application Management > Manage Web Applications > select the web application > Click Authentication Providers > select default zone, and select Yes for ...


0

In the end I got around this issue by having permissions at item level rather than folder level. Originally, permission inheritance was being broken on the folder and all files in the folder were inheriting permissions from the folder. Now, the folder inherits permissions from its parent (the list) and the files within the folder all have inheritance ...


0

You can get list by title using var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('Title');


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 ...


4

Why create a custom login page when you can achieve this by breaking the inheritance permission on that document library. Break the inheritance permission on the document library and grant permission to only those users/groups that should have access to the document library. Users/groups not granted access to this document library, will pop-up window asking ...


0

I figured out a query (for SP2007). Please note that Microsoft doesn't allow executing queries, so use on your own risk. This is not an answer to the question, but I believe worth sharing. Hope it helps others. The query retrieves some data from the Config database. You might need to change the name of the database in case it differs in you environment. ...


0

If you have taxonomy associated with items or documents in the List or Library, then you can use OOTB Taxonomy filter box in Left-Side Panel i.e. http://manojmittalblogs.blogspot.in/2015/05/filter-based-onmanaged-metadata-using.html


1

You can try this, or the equivalent in Powershell: SPList list = site.RootWeb.Lists["YourListName"]; SPField field = list.Fields["Name"]; field.CalloutMenu = false; field.CalloutMenuAllowed = SPField.ListItemMenuState.Prohibited; field.ListItemMenu = true; field.ListItemMenuAllowed = SPField.ListItemMenuState.Required; field.Update(); list.Update();


0

Amal helped and I used his code as a start, but this is the full answer. I also switched to getting the folder name instead of ID, that I pass in as fldrName: using (SPSite site = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb web = site.OpenWeb("/Docs/") { SPDocumentLibrary docList = (SPDocumentLibrary)web.Lists["Documents"]; ...


1

if (fldrItem.RoleAssignments.Count > 0) { SPRoleAssignmentCollection assignColl = fldrItem.RoleAssignments; foreach (SPRoleAssignment assignment in assignColl) { if(assignment.Member.Name == group.Name) { //Now you can look into the associated RoleDefinitions from assignment } } }



Top 50 recent answers are included