Skip to main content

Posts

Showing posts from 2010

The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator

 I was beginig the integration in the production plateform. But i found an error when i had to display a customized infopath form : After googling it seems that the state service is not configured correctly. But when i look into the services in the central administration, the state service is configured and selected for my sharepoint application. So, i created a new one using the Sharepoint PowerShell tool : $serviceApp = New-SPStateServiceApplication -Name "<StateServiceName>"   New-SPStateServiceDatabase -Name "<StateServiceDatabase>"  -ServiceApplication $serviceApp   New-SPStateServiceApplicationProxy -Name "<ApplicationProxyName>"  -ServiceApplication $serviceApp -DefaultProxyGroup Where : <StateServiceName> is the name for the service application. <StateServiceDatabase> is the name of the State Service database to create  and associate with the service application. <ApplicationProxyName> is the name of the ap...

Updating SPListItem without triggering event receivers

I had an event receiver applied on documents wich can start, programatically of course, a workflow. In this workflow, i used to update some metadatas in my document item. However that triggers the event receiver a new time and you can imagine the infinate loop. Well! afeter googling i found that it is possible to diable the event firing just before the item.Update or the item.SystemUpdate. In first time i used this method but i didn't made my code in a try catch bloc. After doing that my workflow runs normally and it didn't fires the events in the event receiver. Here is the code : public static class SPListItemExtensions { /// /// Provides ability to update list item without firing event receiver. /// /// /// Disables firing  /// event receiver while updating item. public static void Update ( this SPListItem item , bool doNotFireEvents ) {     SPItemEventReceiverHandling rh = new SPItemEventReceiverHandling ();     if ( doNotFireEven...

Declarative workflows cannot automatically start if the triggering action was performed by System Account. Canceling workflow auto-start.

 I was developping a sequential workflow wich added a new item in a list that has an autostart workflow associated. However, the workflow is not started. When i try to add a new item in the sharepoint using an account, other than the system account, the workflow is starting correctly. The reason is "if we install SP1 package, then declarative workflows can no longer be triggered by the SharePoint System account" as there is the possibility of security vulnerability. So, they didn't give access to run the declarative workflows under the System account. So, to run that workflow we have to add the item using another user token in our code. Here is the code to use :  SPUserToken tokenCingecom = workflowProperties.Web.AllUsers["UserLogin"].UserToken; using (SPSite impersonatedSite = new SPSite(workflowProperties.SiteId, tokenCingecom)) {      // adding the user }

The Web Application at could not be found. Verify that you have typed the URL correctly

I tried to connect to an existing sharepoint application using a console application in visual studio. I've got the error below : The Web Application at could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. This error occures if the target plateform of build (in the properties of the project) is x86. I just turned it to Any Type and the error diappears :)

The ItemUpdating event or the ItemUpdated event occurs two times

Hi, i've encountred a strage behavior when i was using an event receiver to a document in a sharepoint library. The ItemUpdated fired twice when i upload a new document and i save its metadata. Microsoft said that : "By design, SharePoint  works in this manner. When you check out a document in a document library, a local copy of that document is created. Changes that you make to that document are saved to the local copy. When you check in the document, the operation occurs in two separate steps. The local copy is first saved to the server. This save operation occurs even if you do not make any changes to the document. Then, a separate request is performed to check in the document. Therefore, the ItemUpdating event or the ItemUpdated event occurs two times." But i didn't activate versionning on this document librar. I found in the microsoft KB a note tolding that it can occurs if a required field is installed in the library. So i made all the requir...

Printing ASPX HTML Forms

Here is the way to print a part of a HTML, ASPX Form    This is the content in the page to print <script language=JavaScript> <!-- function printPartOfPage(elementId) {  var printContent = document.getElementById(elementId);  var windowUrl = 'about:blank';  var uniqueName = new Date();  var windowName = 'Print' + uniqueName.getTime();  var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');  printWindow.document.write(printContent.innerHTML);  printWindow.document.close();  printWindow.focus();  printWindow.print();  printWindow.close(); } // --> </script> <div id="printDiv">  This is the content in the page to print </div> ////////////////////////// // To fire the event: ////////////////////////// <input type="button" value="Print" onclick="JavaScript:printPartOfPage('printDiv');" >

Retrieve items from External Lists in SharePoint 2010

I was looking to get some items from an external List programmatically. I made the simple code as used with sharepoint list. But, an exception was fired => "Access denied". After googling, i found that i didn't create the context object that allows the call to the external sevice. Here is the code : SPServiceContext context = SPServiceContext .GetContext(mySite); SPServiceContextScope contextScope = new SPServiceContextScope (context); //.. add your  code to retrieve items as used with sharepoint lists Here is some code snippet for using External lists :   http://msdn.microsoft.com/en-us/library/ff464347.aspx

Samedi 6 novembre prochain SharePoint Saturday français.

Au programme, un ensemble de sessions relatives à SharePoint présentées par des speakers reconnus comme experts dans leur domaine : SharePoint Workspace ne sera pas en reste puisqu’une session lui sera consacrée. Et en cette période de pénurie d’essence, le SharePoint Saturday apparait comme une idée judicieuse : inutile de se déplacer, l’ensemble des sessions sont visibles en ligne ! Dernier point important : c’est GRATUIT ! Voici le programme de la journée : 09:00-09:15 : Ouverture table ronde. 09:30-10:15 : Nicolas GEORGEAULT – SharePoint et la Mobilité 10:30-11:15 : Xavier VANNESTE – Content Management dans SharePoint 11:30-12:15 : Kevin TRELOHAN – La dématérialisation avec la solution ecopy 12:15-13:30 : Pause déjeuner / Partenaires 13:30-14:15 : Fouad HAMDI – Quest 14:30-15:15 : Benoit HAMET – Office Web Application, ou tout votre bureau accessible depuis un navigateur 15:30-16:15 : Fabrice BARBIN – Découverte de SharePoint Workspace 2010 16:30-17:15 : Arnaul...

SharePoint Saturday France le 6 Nov. 2010

Rejoignez les architectes, les développeurs, les administrateurs, designers et autres professionnels qui travaillent avec SharePoint Server 2007 et SharePoint 2010 le 6 novembre 2010 pour un événement SharePoint exceptionnel. Les évènements SharePoint Saturday France sont des journées en libre accès, éducative, informative et animée, remplie de sessions de professionnels & MVPs reconnus pour leurs compétences et heureux de pouvoir partager leur expérience. Suivez-nous sur Twitter @clubsharepoint ou chacun des évènements sur le tag #SPSFrance. http://www.sharepointsaturday.com/france Facebook | SharePoint Saturday France

SPJobDefinition Update fires an access denied error

Our Client wanted to migrate its sharepoint plateform 2007 to SharePoint 2010. He encontred an issue when activating a feature wich creates a custom timer Job. When i debugged the code, i found an access denied exception when the job.Delete() method is executed, wich was ubnormal because the activation using stsadm runs correctly. After googling i found an interessant post Paul Kotlyar . He told that SharePoint added a security feature in the Classes inheriting from SPPersistedObject of the namespace Microsoft.SharePoint.Administration . This feature dissallows modification of the above stated objects from content web applications. To solve this issue, the SharePoint API property Microsoft.SharePoint.Administration.SPWebService.ContentService.RemoteAdministratorAccessDenied has to be set to false. The file joined is the script that i used from to fix this issue without changing any thing in the feature code. Don't forgot to unlock the ps1 file ;) SetRemoteAdministrator...