1

I am trying to copy Calendar items from one list to another list in SharePoint online uisng CSOM. All the fields data copying as excepted but the Recurrence field data appearing as #RENDER FAILED as shown in image. Calendar

Please note that i am trying to copy items from one site collection to another site collection Below is my code:

                    try
                    {
                    itemToCreate["Title"] = SourcelistItem["Title"];
                    itemToCreate["Location"] = SourcelistItem["Location"];
                    itemToCreate["EventDate"] = SourcelistItem.FieldValues["EventDate"];
                    itemToCreate["EndDate"] = SourcelistItem.FieldValues["EndDate"];
                    itemToCreate["fRecurrence"] = SourcelistItem.FieldValues["fRecurrence"];
                    itemToCreate["RecurrenceData"] = SourcelistItem.FieldValues["RecurrenceData"];

                    itemToCreate["TimeZone"] = SourcelistItem.FieldValues["TimeZone"];
                    itemToCreate["XMLTZone"] = SourcelistItem.FieldValues["XMLTZone"];
                    itemToCreate["UID"] = SourcelistItem.FieldValues["UID"];
                    itemToCreate["Duration"]= SourcelistItem.FieldValues["Duration"];
                    }
                    catch (Exception ex)
                    {

                        lbl_Error.Text += ex.Message.ToString();
                    }                       

                itemToCreate.Update();
                destinationContext.Load(itemToCreate);
                destinationContext.ExecuteQuery();

Do i need to include any other columns for copying the Recurrence data

1

After including EventType the issue was fixed. The full code is as below

try
{
itemToCreate["Title"] = SourcelistItem["Title"];
itemToCreate["Location"] = SourcelistItem["Location"];
itemToCreate["EventDate"] = SourcelistItem.FieldValues["EventDate"];
itemToCreate["EndDate"] = SourcelistItem.FieldValues["EndDate"];
itemToCreate["fRecurrence"] = SourcelistItem.FieldValues["fRecurrence"];
itemToCreate["RecurrenceData"] = SourcelistItem.FieldValues["RecurrenceData"];    
itemToCreate["TimeZone"] = SourcelistItem.FieldValues["TimeZone"];
itemToCreate["XMLTZone"] = SourcelistItem.FieldValues["XMLTZone"];
itemToCreate["UID"] = SourcelistItem.FieldValues["UID"];
itemToCreate["Duration"]= SourcelistItem.FieldValues["Duration"];
itemToCreate["EventType"]= SourcelistItem.FieldValues["EventType"];
}
catch (Exception ex)
{

lbl_Error.Text += ex.Message.ToString();
}                       

itemToCreate.Update();
destinationContext.Load(itemToCreate);
destinationContext.ExecuteQuery();
0

When you copy the "fRecurrence" flag it do only true/false flag. In the form when you check the option it will ask for which day and how many days it occur. System uses that additional information to render as shown in source site screenshot (e.g: Every 1 day(s)).

I am not exactly sure how to copy that additional info but I will update my answer if I can get it.

  • Thanks for the reply. I have updated my code and tested now nothing is happening.. recurrence filed is empty – TARUN Apr 20 '17 at 5:21
  • Can you check how the RecurrenceData XML stored in the destination list. This is going to be parsed and display on screen. – Venkat Konjeti Apr 20 '17 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.