Sharepoint online Record Management Using CSOM

%3CLINGO-SUB%20id%3D%22lingo-sub-51738%22%20slang%3D%22en-US%22%3ESharepoint%20online%20Record%20Management%20Using%20CSOM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-51738%22%20slang%3D%22en-US%22%3E%3CP%3EThere%20is%20good%20update%20with%20microsoft.Sharepoint.client%20version%2016.1.0.0.%3C%2FP%3E%3CP%3EBut%20i%20am%20getting%20fade%20up%20with%20records%20management%20throw%20code%20as%20below.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20working%20with%20Clinet%20object%20model%20with%20c%23%20in%20console%20app.%3C%2FP%3E%3CP%3ECurrently%20i%20am%20using%20%26nbsp%3B%22Microsoft.SharePoint.Client%22%20version%20%2216.1.0.0%22.%3C%2FP%3E%3CP%3EI%20ahve%20fetched%20all%20the%20the%20document%20library%20items%20and%20i%20need%20to%20check%20current%20item%20is%20%22Declared%20as%20record%22%20or%20not.If%20not%20then%20i%20need%20to%20do%20declare%20as%20record%20to%20respective%20listItem.%3C%2FP%3E%3CP%3EI%20am%20using%20below%20method%20to%20check%20item%20is%20%22Declared%20as%20Record%22%20or%20not%20and%20method%20is%20part%20of%20the%20class%20%22Microsoft.SharePoint.Client.RecordsRepository%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EClientResult%3CBOOL%3E%20ItemAsRecord%20%3D%20Records.IsRecord(context%2C%20listitem)%3B%3C%2FBOOL%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20am%20getting%20ItemAsRecord.Value%20%3D%20false%20for%20each%20item%20whether%20it%20is%20%22Declared%20As%20Record%22%20or%20not.%3C%2FP%3E%3CP%3Eand%20if%20item%20declared%20as%20record%20than%20method%20throws%20exception%20with%20result%20%22False%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20i%20have%20checked%20the%20class%20and%20i%20found%20that%20sharepoint%20client%20object%20model%20use%20below%20method%20to%20check%20status%20of%20record%20against%20the%20item.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EClientAction%20clientAction%20%3D%20new%20ClientActionInvokeStaticMethod(context%2C%20%22%7Bea8e1356-5910-4e69-bc05-d0c30ed657fc%7D%22%2C%20%22IsRecord%22%2C%20new%20object%5B%5D%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7B%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bitem%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D)%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20am%20not%20getting%20that%20why%20object%20model%20use%20static%20value%20for%20%22String%20TypeID%22%20parameter.%3C%2FP%3E%3CP%3EWhat%20is%20diffrence%20between%20methods%20%22%3CSTRONG%3EClientActionInvokeStaticMethod()%20%26amp%3B%26nbsp%3BClientActionInvokeMethod()%3C%2FSTRONG%3E%22.%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20i%20get%20result%20%22true%22%20if%20item%20declared%20a%20record.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-51738%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-127683%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20Record%20Management%20Using%20CSOM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-127683%22%20slang%3D%22en-US%22%3E%3CP%3EExecute%20context.ExecuteQuery()%20after%20the%20IsRecord%20statement%20to%20get%20the%20results%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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. 

 

 

 

1 Reply

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