Error : "value does not fall within the expected range"
-
Good day Please help On SharePoint 2010, I have created a timer job that will declare items as records, this works in the development environment but fails when I deploy in the testing environment. This fails on this line of code Records.DeclareAsRecord(spListItem); error I am getting is "value does not fall within the expected range" I have done checks in code to see if record is checkout = None record is locked = false record is declared = false Any help will be appreciated. Thank you
-
Good day Please help On SharePoint 2010, I have created a timer job that will declare items as records, this works in the development environment but fails when I deploy in the testing environment. This fails on this line of code Records.DeclareAsRecord(spListItem); error I am getting is "value does not fall within the expected range" I have done checks in code to see if record is checkout = None record is locked = false record is declared = false Any help will be appreciated. Thank you
Without seeing all the code that is inserting the new record, this would be difficult to see whats going on. Since you are using the “static” methods DeclareItemAsRecord/UndeclareItemAsRecord. You might just be running into a simple duplicate record scenario. // Check for the existence of the record first if (Records.IsRecord(spListItem)) Records.UndeclareItemAsRecord(spListItem); // Then do your declare Records.DeclareAsRecord(spListItem); If this works you will at least you will know that it was an existing record issue and you can adapted your code accordingly.