Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Error : "value does not fall within the expected range"

Error : "value does not fall within the expected range"

Scheduled Pinned Locked Moved SharePoint
helpsharepointtestingbeta-testingcareer
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kgotlelelo
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • K kgotlelelo

      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

      M Offline
      M Offline
      Member 8075923
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups