Forum Discussion

Dipen Shah's avatar
Dipen Shah
Copper Contributor
Mar 09, 2017

Sharepoint online Record Management Using CSOM

There is good update with microsoft.Sharepoint.client version 16.1.0.0.

But i am getting fade up with records management throw code as below.

 

I am working with Clinet object model with c# in console app.

Currently i am using  "Microsoft.SharePoint.Client" version "16.1.0.0".

I ahve fetched all the the document library items and i need to check current item is "Declared as record" or not.If not then i need to do declare as record to respective listItem.

I am using below method to check item is "Declared as Record" or not and method is part of the class "Microsoft.SharePoint.Client.RecordsRepository".

 

ClientResult<bool> ItemAsRecord = Records.IsRecord(context, listitem);

I am getting ItemAsRecord.Value = false for each item whether it is "Declared As Record" or not.

and if item declared as record than method throws exception with result "False".

 

So i have checked the class and i found that sharepoint client object model use below method to check status of record against the item.

 

ClientAction clientAction = new ClientActionInvokeStaticMethod(context, "{ea8e1356-5910-4e69-bc05-d0c30ed657fc}", "IsRecord", new object[]
    {
        item
    });

I am not getting that why object model use static value for "String TypeID" parameter.

What is diffrence between methods "ClientActionInvokeStaticMethod() & ClientActionInvokeMethod()". 

How can i get result "true" if item declared a record. 

 

 

 

  • Ramy Farag's avatar
    Ramy Farag
    Brass Contributor

    Execute context.ExecuteQuery() after the IsRecord statement to get the results

Resources