Skip to main content

Posts

The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator

You might have developed a functionality where data is being saved in a SharePoint list. By the time you developed this functionality it was working fine.As users adds the data , some day your functionality doesn't work. That means, the data which is present in the list is not being retrieved. Don't be panic. Just open the LOG file which is present in 14 hive folder. You will come to know about this bug with the statement -"The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator". Now what you have to do is, go to central administration site.  1.Click on Manage web application 2.Select the web application on which your sitecollection is created. 3.Click on General settings and select Resource throttling 4.by default list view threshold would be 5000. your list might have data more than 5000. So , increase the number to required threshold limit. you can make it 10000, 20000 like this. Do a i...

Retrieve recent 7 days items from SharePoint list using CAML Query

This is an interesting stuff even though it is very simple. Assume we have to retrieve  recent 7 days items from a sharepoint list. For this purpose obviously we need to use CAML query (static query, not dynamic) . You can use the following code snippet for the reference.  Assume you have got SPSite object and continue with the following snippet. SPList list = site.RootWeb.Lists["PradeepaStats"]; SPQuery query = new SPQuery(); query.Query = "<Where><Eq><FieldRef Name='TaskDueDate' /><Value IncludeTimeValue='TRUE' Type='DateTime'>[Today-7Day(s)]</Value></Eq></Where>"; SPListItemCollection items = list.GetItems(query); Hope this  may help someone Cheers Pradeepa achar

This solution contains invalid markup or elements that cannot be deployed as part of a sandboxed solution. Solution manifest for solution 'cc218449-78b3-4430-b401-4884977560e2' failed validation, file manifest.xml, line 11, character 4: The element 'Solution' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'TemplateFiles' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'FeatureManifests, ActivationDependencies' in namespace 'http://schemas.microsoft.com/sharepoint/'. Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: oplh6595a-a6hg-416f-a85f-a173bp03dda6 Date and Time: 30/10/2013 13:33:18

By looking at this bug you may get shocked and may not understand why this is happening. I can say, you have developed a wsp of farm solution, not the sandboxed solution  using visual studio and added some OOTB webparts such as visual webparts and trying to deploy the solution via solution gallery directly on to the sharepoint site. It is so simple.Understand that, when you create a .wsp file using visual studio, you deploy as farm solution. But when you try to deploy the same solution from site settings-> solution gallery, you deploy it as sand boxed solution. In this situation ,the "TemplateFiles" elements refers to the items that will be copied into the web servers. This is allowed only in farm solutions , not in sandboxed solutions. I suggest you guys to deploy the solution either using stsadm command or powershell command, so that it will work fine.If anyone wants to know about how to deploy using powershell command you can refer the   techNet  document ...

This solution contains no resources scoped for a web application and can not be retracted from a particular web application

While retracting/ deploying  sharepoint solution using visual studio or stsadm command you might have got following errors , such as 1.If you are using  "'Retract Solution': C:\Windows\Temp\solution-b254f31c-6d03-41c0-869c-e0755c54a1e0\SOLUTION.wsp could not be created because the contents could not be found under id fc52e867-4f3f-4d65-a348-2406fd83635e in the configuration database." 2.If you are using stsadm command "This solution  contains no resources scoped for a web application and can not be retracted from a particular web application"  The above two errors are belonging to represent the same issue. This issue occurs because of improper activation of the feature. When you deployed the same solution or some other solution on the site, it might have given  you the message as 'deployed successfully', but might not have activated feature properly. In order to fix this issue use the following stsadm command and retract and remove those s...

Test Database connection and extract the connectionstring element

1.    Create a notepad file.  2.    Open the file and click on File menu Save as  Now give the name for file and enter the extension as .udl and Save as type as All Files. Here the file name is dbTest.udl 3.    The file will look as follows 4.    Now double click on the dbTest.udl file. An window will get opened 5.    Select the server name.. Usually ServerName\Sharepoint 6.    Choose windows NT Integrated security (if) else enter the db engine password. 7.    Now Select the DB name under the point number (3) 8.    Now Click On Test Connection. If it shows Success message then the connection is happening and you can copy the generated connection string and make use. Open the File in notepad and you can find the connection string Now extract the connection string a...

Event Receiver for SharePoint list item

Before writing event receiver, you should have the Sharepoint list for which you are going to write the event receiver.If you have long term goal of creating multiple event receiver for lists, maintain a folder for these event receiver. 1.        Create a folder EventReceiver 2.        Right click on the folder EventReceiver à Select Add option à Select New Item option               3 .        On the opened window, select the   Visual C#-->Sharepoint 2010 and now select the Event Receiver Template            In the Name textbox which is  present below,Give the LISTNAMEEventReceiver. i.e suppose you are going write event receiver for ActionTracker list, then the event receiver’s name would be ActionTrackerEventReceiver After entering the name , click on Add button.       ...

Code branching in TFS

Being in the IT world we should be always thirsty in learning new things apart from the regular work. In the world of .net , we are using to have a code repository called TFS.    First of all we should know what is TFS?    TFS refers to the Team Foundation Server to which all the development systems would be connected , so that the CODE will have its own house. I will show simple example here The developer needs to  check-in  the code to the TFS server so that when the other developer takes the updates from the TFS, he will get the recently checked-in code, so that he will be having updated code. Before client release, we need to have stable branch of the code which is thoroughly tested and branched as separate version and so that developer can continue check-in the code in the current trunk in the TFS as they complete the developement , so that if there is any bug or issues in the recently checked-in code ,there will not be any probl...