{"id":830,"date":"2013-04-29T16:03:31","date_gmt":"2013-04-29T23:03:31","guid":{"rendered":"https:\/\/mmman.itgroove.net\/?p=830"},"modified":"2023-02-24T21:48:45","modified_gmt":"2023-02-24T21:48:45","slug":"undeclare-a-single-record-in-a-list","status":"publish","type":"post","link":"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/","title":{"rendered":"Undeclare a Single Record in a List"},"content":{"rendered":"<p>Following on this <a href=\"http:\/\/social.technet.microsoft.com\/Forums\/en-US\/sharepointgeneralprevious\/thread\/c8182c58-8016-4aee-9412-0764edc30e28\">forum post<\/a>, and this <a href=\"http:\/\/www.mysharepointadventures.com\/2012\/06\/undeclare-declare-all-some-records-in-a-list\/\">blog post<\/a>, I wanted to be able to undeclare a specific record.\u00a0 In my case, I wanted to undeclare a record by \u201cID\u201d, but you could really do this by any (unique enough) attribute of a record.<\/p>\n<p>The code I used to do this was essentially as follows.<\/p>\n<p>[sourcecode lang=&#8221;Powershell&#8221;]<br \/>\n$SPAssignment = Start-SPAssignment<br \/>\n$sitename = &quot;https:\/\/YourSiteGoesHere&quot;<br \/>\n$listname = &quot;YourListNameGoesHere&quot;<\/p>\n<p>$web = Get-SPWeb $sitename -AssignmentCollection $spAssignment<br \/>\n$list = $web.lists[$listname].items<\/p>\n<p>foreach ($item in $list)<br \/>\n{<br \/>\n     $IsRecord = [Microsoft.Office.RecordsManagement.RecordsRepository.Records]::IsRecord($Item)<br \/>\n     if ($IsRecord -eq $true){<br \/>\n         if ($item.id -eq 21412)<br \/>\n         {<br \/>\n             Write-Host &quot;Undeclared $($item.Title)&quot;<br \/>\n             [Microsoft.Office.RecordsManagement.RecordsRepository.Records]::UndeclareItemAsRecord($Item)<br \/>\n         }<br \/>\n     }<br \/>\n}<br \/>\nStop-SPAssignment $SPAssignment<\/p>\n<p>[\/sourcecode]<\/p>\n<p>The above code goes through all the records in the list, and finds the one that matches the ID I was interested in.\u00a0 It then undeclares it as a record, and I was then able to make the necessary change.<\/p>\n<p>To customize this to your needs, you\u2019d need to change the highlighted values for the sitename URL, the list name (within the site), and the value of the item\u2019s ID.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following on this forum post, and this blog post, I wanted to be able to undeclare a specific record.\u00a0 In my case, I wanted to undeclare a record by \u201cID\u201d, but you could really do this by any (unique enough) attribute of a record. The code I used to do this was essentially as follows. &hellip; <a href=\"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/\"><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[31,7],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Undeclare a Single Record in a List - Archive<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Undeclare a Single Record in a List - Archive\" \/>\n<meta property=\"og:description\" content=\"Following on this forum post, and this blog post, I wanted to be able to undeclare a specific record.\u00a0 In my case, I wanted to undeclare a record by \u201cID\u201d, but you could really do this by any (unique enough) attribute of a record. The code I used to do this was essentially as follows. &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Archive\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-29T23:03:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-24T21:48:45+00:00\" \/>\n<meta name=\"author\" content=\"Colin Phillips (Alumni)\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Colin Phillips (Alumni)\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/\",\"url\":\"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/\",\"name\":\"Undeclare a Single Record in a List - Archive\",\"isPartOf\":{\"@id\":\"https:\/\/regroove.ca\/archive\/#website\"},\"datePublished\":\"2013-04-29T23:03:31+00:00\",\"dateModified\":\"2023-02-24T21:48:45+00:00\",\"author\":{\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b\"},\"breadcrumb\":{\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog Archive\",\"item\":\"https:\/\/regroove.ca\/archive\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Undeclare a Single Record in a List\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/regroove.ca\/archive\/#website\",\"url\":\"https:\/\/regroove.ca\/archive\/\",\"name\":\"Archive\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/regroove.ca\/archive\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b\",\"name\":\"Colin Phillips (Alumni)\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g\",\"caption\":\"Colin Phillips (Alumni)\"},\"url\":\"https:\/\/regroove.ca\/archive\/author\/cphillips\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Undeclare a Single Record in a List - Archive","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/","og_locale":"en_US","og_type":"article","og_title":"Undeclare a Single Record in a List - Archive","og_description":"Following on this forum post, and this blog post, I wanted to be able to undeclare a specific record.\u00a0 In my case, I wanted to undeclare a record by \u201cID\u201d, but you could really do this by any (unique enough) attribute of a record. The code I used to do this was essentially as follows. &hellip;","og_url":"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/","og_site_name":"Archive","article_published_time":"2013-04-29T23:03:31+00:00","article_modified_time":"2023-02-24T21:48:45+00:00","author":"Colin Phillips (Alumni)","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Colin Phillips (Alumni)","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/","url":"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/","name":"Undeclare a Single Record in a List - Archive","isPartOf":{"@id":"https:\/\/regroove.ca\/archive\/#website"},"datePublished":"2013-04-29T23:03:31+00:00","dateModified":"2023-02-24T21:48:45+00:00","author":{"@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b"},"breadcrumb":{"@id":"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/regroove.ca\/archive\/2013\/04\/29\/undeclare-a-single-record-in-a-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Archive","item":"https:\/\/regroove.ca\/archive\/"},{"@type":"ListItem","position":2,"name":"Undeclare a Single Record in a List"}]},{"@type":"WebSite","@id":"https:\/\/regroove.ca\/archive\/#website","url":"https:\/\/regroove.ca\/archive\/","name":"Archive","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/regroove.ca\/archive\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b","name":"Colin Phillips (Alumni)","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g","caption":"Colin Phillips (Alumni)"},"url":"https:\/\/regroove.ca\/archive\/author\/cphillips\/"}]}},"_links":{"self":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/830"}],"collection":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/comments?post=830"}],"version-history":[{"count":1,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/830\/revisions"}],"predecessor-version":[{"id":1942,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/830\/revisions\/1942"}],"wp:attachment":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/media?parent=830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/categories?post=830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/tags?post=830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}