Getting the value for field _IsRecord #1157
Replies: 4 comments
-
Hi, I noticed the following sentence is not returning the field: var fieldIsRecord = await retrievedList.Fields.Where(p => p.InternalName == "_IsRecord").FirstOrDefaultAsync(); This is what I need: I get a request to delete a file and with that request I only get the SiteUrl and the File Guid. I need to do the following: 1-Check the value in field _IsRecord, this field is part of the listitem collection and it is not part of the ListItemAllFields, I assume I need the reference to the item in the list. How I can get the item from the File Guid? Thank you very much for your time and help, much appreciated |
Beta Was this translation helpful? Give feedback.
-
I think I can get the field as follow, but I am not sure how to get the value store in this type of field. Thanks // Get a reference to the file
|
Beta Was this translation helpful? Give feedback.
-
See https://github.com/pnp/pnpcore/blob/dev/src/sdk/PnP.Core.Test/SharePoint/ListItemTests.cs#L5047-L5095 for a sample on compliance work, it also shows how to retrieve those fields via a CAML query. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am implementing a function to delete a file in a document library. Before I delete the file I need to check whether the file is a Record or not, therefore I need to check the value in the field "_IsRecord". This field is part of the SharePoint Record Management functionality.
My question is how I can get the value in this field? (Values can be Yes or No)
This is my code:
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions