Question

J'essaie de créer un calendrier personnalisé dans une fonctionnalité, mais quelque chose ne fonctionne pas correctement. Je suis capable de créer des événements, mais si j'essaie de créer un événement récurrent, je reçois une erreur. J'utilise SharePoint 2013 et j'essaie de déployer ma fonctionnalité via Visual Studio 2012.

Étapes pour reproduire Dans Visual Studio

  1. Ajouter un nouvel article
  2. Liste
  3. Créez un modèle de liste de liste personnalisée et instance de liste: une. Sélectionnez "Calendrier" dans Drop Down.
  4. Déployer

    Quelques comportements étranges que j'ai remarqués.

    1. au lieu de la barre de ruban de calendrier normale avec des "événements" et "calendrier", j'en reçois un avec "articles", "Liste" et "Calendrier".
    2. Lorsque je vérifie la case à cocher "récurrence", un calendrier créé via SharePoint UI remplira automatiquement la date de début. Dans mon calendrier, ce champ est vide par défaut. Je suis capable de le remplir.

      Voici le message d'erreur.

      system.web.httpunhandledexception (0x80004005): exception de type 'system.web.httpunhandledexception' a été lancée. ---> System.ArgumentException: la valeur ne tombe pas dans la plage attendue. chez Microsoft.SharePoint.WebControls.Recurrencefield.Setrecurencefields () chez Microsoft.SharePoint.WebControls.Recurrencefield.comPletitemload () chez Microsoft.SharePoint.WebControls.SaveButton.AgryBeForesAveItem (SPContext itemContext) chez Microsoft.SharePoint.WebControls.SaveButton.SaveItem (SPContext itemContext, Boolean UploadMode, string Checkcomment) chez Microsoft.SharePoint.WebControls.SaveButton.onbubbleevent (Source d'objet, evenargs e) À System.Web.UI.Control.ReiseBubbleEvent (Source d'objet, Eventargs args) À System.Web.UI.Page.ProcessRequestMain (Boolean IncLutStagesBeForeAsyncPoint, Boolean IncLutestagesAfTerAsynCpoint) au système.web.ui.page.handleError (exception e) À System.Web.UI.Page.ProcessRequestMain (Boolean IncLutStagesBeForeAsyncPoint, Boolean IncLutestagesAfTerAsynCpoint) chez System.Web.UI.Page.ProcessRequest (Boolean InclutStagesBeForeAsynCpoint, Boolean IncluttagesAfterAsyncPoint) au système.web.ui.page.processRequest () à System.Web.UI.Page.ProcessRequest (contexte httpcontext) chez ASP.FORM_ASPX_405394071.ProcessRequest (contexte httpcontext) en C: \ Windows \ microsoft.net \fray64 \ v4.0.30319 \ Fichiers ASP.NET temporaires \ root \ 9251A794 \ cea24f96 \ app_web_form.aspx_40394071.bveoxq2l.0.cs: Ligne 0 à System.Web.httpApplication.CallhandlerExecutionStep.System.web.httpApplication.executionStep.Execute () au système.web.httpApplication.executstep (iExecutionStep Step, Boolean & TerminalSynchrone)

Était-ce utile?

La solution 2

Instead of creating the calendar through a feature element, I decided to give it a go programmatically. I deleted the list from Visual Studio, and I am using the overload of SPListCollection.Add that uses SPListTemplateType in my FeatureActivated method. By passing in SPListTemplateType.Events, the calendar is created and functions properly.

I am also able to add custom content types and fields to the calendar in my FeatureActivated method.

I'd still like to get to the root of the problem with using the feature element, if anyone has any ideas.

Autres conseils

Just in case someone else comes across this question -> Here is my solution that works in Visual Studio with a Custom List Definition based on Calendar.

You need to edit the following:

Elements.xml for the List Definition -> Change the "Type" attribute to 106. This will create a list based on the SPListTemplateTypeId 106 (Calendar) http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splisttemplatetype.aspx

Elements.xml for the List Instance -> Change the TemplateType attribute to 106.

Schema.xml for the List Definition -> Change the DefaultView="TRUE" to DefaultView="FALSE" for the BaseViewID="1" and then change DefaultView="FALSE" to DefaultView="TRUE" for BaseViewID="2". This will enable the proper View/Ribbon bar when the list is first instantiated.

Jason

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top