Skip to main content

Posts

Showing posts from November, 2010

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