none
How to reovery record / add list data without trigger event handler and using user ID (.NET Console App or PowerShell ) RRS feed

  • Question

  • Greetings, I have following record removed by user, I would like to readd it without trigger event handler and using orginal user ID, how can I do? (If possible, please also let me have some code sample/URL for data casting if it should considered, as I have drop down, name fields and date fields in the list...)

    thanks you very much for your attention.

    Data

    * It stored in XML format in SharePoint list backup file, but I can transfer to other format manually.

    <Field Name="Title" Value="ABC09-0011"/>
    <Field Name="_ModerationComments" FieldId="34ad21eb-75bd-4544-8c73-0e08330291fe"/>
    <Field Name="File_x0020_Type" FieldId="39360f11-34cf-4356-9945-25c44e68dade"/>
    <Field Name="Requestor" FieldId="1a42bc00-fee2-4b33-ba12-86786ec86fe1" Value="Marry O.O/"/>
    <Field Name="SendorReceive" FieldId="d80e31a3-5956-4952-9cd8-79ca662c07ca" Value="Receiving"/>
    <Field Name="GiveorReceiveDate" FieldId="000264bb-4279-4054-a7a7-26a3629de532" Value="09/09/2013 16:00:00"/>
    
    <Field Name="Description" FieldId="87cbf830-d9fa-4490-9fa5-ace7cb2cd6ee" Value="X'MAS"/>
    
    <Field Name="BusRationale" FieldId="22149025-72bc-43c5-b7f9-c0df8c443c8b" Value="A"/>
    
    <Field Name="Nature" FieldId="3b2ebaad-1fc8-47e5-9da5-56b7d20607cd" Value="Gift"/>
    
    <Field Name="government" FieldId="e83e6a90-90da-4414-bd92-d0d1c9fc6984" Value="False"/>
    
    <Field Name="Company" FieldId="1168e947-069c-4c2e-a273-38b361ce640a" Value="ABC Company"/>
    
    <Field Name="BusRelationship" FieldId="12404b0d-4d4e-4d4c-80c6-0e9fe28c3f2c" Value="Agency"/>
    
    <Field Name="SenderorReceiver" FieldId="bc0ea0c6-4fdd-4b24-960d-ad46eb255068" Value="XYZ "/>
    
    <Field Name="JobTilte" FieldId="02883115-d3aa-42c0-916c-0f57cabce59d" Value="SRD"/>
    
    <Field Name="value" FieldId="b93dd856-51ea-4a07-b050-3ceeb4e18043" Value="1800"/>
    
    <Field Name="Remark" FieldId="bbd663ec-7df8-46bd-8d74-e77c4db9c70d"/>
    
    <Field Name="RequestorID" FieldId="2e9e58b3-d61b-4b9f-8374-b34ce7462754" Value="674;# ;#674;# ;4a330fc0-13df-4309-8198-89f303a65832"/>
    
    <Field Name="Approver" FieldId="68cb3b2b-c239-49e3-86d1-8aad695794c6" Value="410;44f592e5-eaa2-467b-ac23-ef6ae403fb10"/>
    
    <Field Name="ApprovalStatus" FieldId="169bbc11-ef4a-49b4-beb4-680585579576" Value="Pending for Approval"/>
    
    <Field Name="V3Comments" FieldId="6df9bd52-550e-4a30-bc31-a4366832a87e"/>
    
    <Field Name="RequestPerson" FieldId="0182dcbb-6649-424a-af1e-20d93c09be08" Value="449;44f592e5-eaa2-467b-ac23-ef6ae403fb10"/>
    


    .NET Beginner 3.5

    Tuesday, March 14, 2017 4:30 AM

All replies

  • Hi,

    We can disable the event receiver with base.EventFiringEnabled property like below to avoid triggering event receiver:

        public override void ItemAdded(SPItemEventProperties properties)
            {
                base.ItemAdded(properties);
                base.EventFiringEnabled = false;
                
            }

    More information:

    How To Disable Events From Firing On SharePoint 2013

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, March 15, 2017 6:45 AM