Posts

Showing posts with the label microsoft

Sharepoint 2010 Globally Reusable Workflows does not update WF instance in Subsite if re-published: PS Script save me

I defined a Globally Reusable WF for a custom Content Type in root site, with a custom form with InfoPath. I defined a sub site with a list using the global WF template created for its Content Type. Everything works without problems. Now I need to change the WF (both in form and in the process). BUT.. If I edit only the form with InfoPath and then I publish the form, I see correctly the new form in WF on subsites. If I change the WF logic too (any actions) and publish WF (in root site), changes are not perceived by WF on subsites. WF on subsite is updated only if, on subsite, I open WF to change (from browser) and save it. I expect that you can update all WF in subsite using template in root site, without having to reopen and resave each WF in each subsite. I don't understand if it's a bad configuration or a issue on Globally Reusable WF. (I opened question in Technet Forum, here ) UPDATE: Sometimes, I update a WF (form and logic) and logic has been correctly pub...

Sharepoint 2010 - Email Event Receiver Issues

Image
The Email event receiver is not so simple to create and execute... I experienced some issues for the correct configuration. EmailReceived Method: wrong reference in Handle Email Receiver method created by VS When you create the email event receiver you see the method EmailReceived. In Visual Studio, see properties of event receiver and you see "handle email receiver" = false. If you set to true, VS creates method EmailReceiver with Microsoft.Sharepoint.SPEmailMessage insthead of Microsoft.Sharepoint.Utilities.SPEmailMessage. This cause error in build event receiver. I think is an issue/bug of Sharepoint 2010, but I did not found any documentation in MS. Solution : The event receiver work fine without set "handle" property to true. Leave this setting to false. Email Event Receiver: SPContext.Current is null Solution : use list.ParentWeb, from the list property of method EmailReceived. Email Event Receiver: if you have to process attachment of email If y...

Sharepoint 2010 - Enable/Disable Ribbon Button with EcmaScript

I show you a detailed example of how to enable and disable a ribbon button according to the current user’s group. The example uses “EnabledScript” attribute of the CommandUIHandler of the ribbon button. Then the EnabledScript is built with EcmaScript to find groups and user info. Lets Start with creating a Ribbon button first. 1. Create a empty project. 2. Deploy it as a Farm solution. 3. Right click on the feature and click “Add feature”. 4. Right click on the project and add a new “Empty Element” item. 5. Next add the below code to add a custom Ribbon button to your document library. <Elements xmlns=”http://schemas.microsoft.com/sharepoint/” > <CustomAction Id=”ButtonForGroupUsersOnly” Location=”CommandUI.Ribbon” RegistrationId=”101″ RegistrationType=”List” Title=”Owners Group Button”> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location=”Ribbon.Library.ViewFormat.Controls._children”> <Button Id=”Ribbon.L...

Estrarre immagini da PDF o convertire pagine PDF in immagini in C#

E' stata dura. Molto dura. Una nuova sfida: Estrarre immagini da un PDF o convertire una pagina PDF in una immagine. Con C#. Ho dovuto guardarmi parecchi forum e blog per arrivare ad una soluzione decente, free e con poco sforzo. Partiamo dal primo caso: Estrazione di una immagine da una pagina di un documento PDF. Ho utilizzato iTextSharp, che normalmente usiamo per generare PDF, ma che è stato utile per leggere il file e trovare in esso le immagini. Il metodo qui sotto ritorna lo stream dell'immagine.. perché a me serviva così. Vediamo il codice (dopo aver referenziato la DLL di iTextSharp): using iTextSharp.text; using iTextSharp.text.pdf; static Stream ExtractImagesFromPDF(string sourcePdf) { System.IO.MemoryStream streamImage = new MemoryStream(); // NOTE: This will only get the first image it finds per page. PdfReader pdf = new PdfReader(sourcePdf); RandomAccessFileOrArray raf = new iTextSharp.text.pdf.RandomAccessFileOrArray(sourcePdf); int numbOfPag...

Sharepoint 2007 - Exception from HRESULT: 0x8102009B

Per la serie "Messaggi di Errore Parlanti", ecco la spiegazione dell'errore indicato qui sotto: Microsoft.SharePoint.SPException: Exception from HRESULT: 0x8102009B  System.Runtime.InteropServices.COMException (0x8102009B): Exception from HRESULT: 0x8102009B at Microsoft.SharePoint.Library.SPRequestInternalClass.AddWorkflowToListItem(String bstrUrl, String bstrListName, Int32 ….. Bene: si sta tentando di avviare una nuova istanza di un workflow, ma quel workflow è già avviato oppure è in errore. Rimuovere le istanze di workflow, interrompere il flusso attivo e .. riprova sarai più fortunato.

Microsoft Dynamics CRM 2011 - DeletionStateCode Missing

Image
La nuova versione CRM 2011 porta in sé un certo numero di modifiche, di cui più o meno si è parlato. Una di cui non si è detto quasi niente non è neppure così banale, per chi sviluppa personalizzazioni.   DeletionStateCode In CRM 4.0, esiste la colonna DeletionStateCode, su ogni entità, a livello di database, e che ci dice quando un record è stato eliminato. I suoi valori sono:  - 0 indica il record è in stato attivo nel database,  - 2 il record è stato contrassegnato per la rimozione, quando il Deletion Job verrà eseguito - 1 il record non è utilizzato.   Schedulando il servizio di Deletion, vengono rimossi dalle tabelle tutti i record con DeletionStateCode = 2. Per fortuna o purtroppo, il servizio spesso non parte o dà problemi o lascia qualche record. Quando sviluppiamo personalizzazioni in CRM, bisogna tener conto della colonna DeletionStateCode dei record, ad esempio per escludere dalle query quelli che sono "in cancellazione" e non più validi. Inoltre, la p...

Sharepoint 2010 - Aggiungere bottone al Ribbon con Sharepoint Designer 2010

Image
Vediamo come aggiungere un bottone personalizzato al Ribbon di una lista o document library, utilizzando solo lo Sharepoint Designer 2010. Apriamo il sito con SPD2010, nelle liste, selezionamo la lista che vogliamo utilizzare. A fondo pagina, vediamo il blocco Azioni Personalizzate. Non clicchiamo su Nuovo, ma facciamo un clic con il mouse all'interno del blocco e dal menu contestuale, scegliamo Azione Personalizzata. Vediamo un menu a discesa con diverse opzioni: La traduzione italiana pessima rende oscura l'interpretazione delle voci... Provo a spiegarle. Menu voci elenco : il bottone è visualizzato nel menu a tendina sull'item Visualizza barra multifunzione modulo : il bottone è visualizzato nella scheda "View properties" Modifica barra multifunzione modulo : il bottone è visualizzato nella scheda "Edit properties" Nuova barra multifunzione modulo : il bottone è visualizzato nella scheda "New item" Visualizza barra multi...

Sharepoint 2007 - Deploy in produzione con Visual Studio 2008

Dopo aver partecipato a corsi di Sharepoint 2010 e visto quanto sia (relativamente ok...) semplice eseguire il Deploy di soluzioni dall'ambiente di test all'ambiente di produzione, mi sono scontrato con la realtà di Sharepoint 2007... Il deploy di una web part custom, implementata con Visual Studio 2008. Lo sviluppo è andato liscio, senza problemi. Il deploy in ambiente di test, ancora più semplice: tasto destro sul progetto, click su Deploy e via. Ora è giunto il momento del deploy in produzione.. Come fare? Diversi forum mi propongono soluzione a detta loro "semplici", con creazione di un progetto CAB per generare un package da copiare in produzione e poi deploy con stsadm. Non è così facile. Almeno, io ho incontrato difficoltà per due motivi: - o riconosce il file come CAB quindi vuole addpackage anziché addsolution - o (se rinominato in .wsp) non vuole addsolution - o mi dice che manca il manifest.xml (pur essendoci) Allora, ho seguito una mia strada. Da Visual S...

Sharepoint 2007 - Incrementare il limite di peso del Site Template

Il limite impostato di default da Sharepoint 2007 per l'operazione "Save as Template" è di 10 Mb. Questo valore può essere cambiato utilizzando il comando stsadm. Posizionarsi nella folder 12 di MOSS2007 (in Drive:\\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\) e avviare il comando seguente: stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 40000000 Nell'esempio, il comando incrementa il limite e 40Mb.

Sharepoint 2010 - Cambiare Lingua al Titolo delle Web Part

Sharepoint 2010 dà la possibilità di implementare la localizzazione dei siti (e dei suoi elementi), grazie alla Multilanguage User Interface. Purtroppo, come ben documentato da MS stessa ( http://technet.microsoft.com/it-it/library/ff805062.aspx#Section7 ), non tutti gli elementi di un sito possono avere al seguito le traduzioni. Una possibilità è quella di utilizzare un controllo client che ci permetta di cambiare lingua al titolo delle web part. Analizzando il codice della pagina prodotta da Sharepoint, ho individuato i tag necessari ad identificare il titolo della web part. Titolo della Web Part La class ms-WPTitle dell'elemento h3 definisce il titolo della web part. Al suo interno, dobbiamo cercare il tag "span" che contiene il titolo. Generalmente è il primo dei due, senza id e, ovviaemente, non vuoto. Bene, sappiamo dove prendere il titolo. Definiamo ora un modo con cui l'utente possa essere autonomo nella gest...

Sharepoint 2007 - When use Lookup Columns instead Choice Columns

Image
There are a number of ways to store options for a field that requires a group of pre-selected options, a drop down list as it were. I always thought that defining a column of the type choice is the way to go but recently discovered that in a couple of areas that creating a list and then using that as a look up is actually a better solution. When to use a Choice Column You should use a choice column, pictured below, in the following circumstances: 1) Only site administrators should be able to add/remove/edit options 2) You don’t have that many options to choose from (maximum ten) and users will usually only select at most 5 options. 3) The options rarely change This is the usual way to go in a SharePoint environment but it can cause many issues. For starters a choice column can only store 255 characters (SharePoint in built field limit) so if your users are choosing 10 options each of 26 characters (see below) then they wont be able to. This is because the choice fied...