Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SharePoint update a locked item.

$
0
0

I am able to bypass the lock and update the managed meta data field only if I run the file containing the following code twice.

Any idea how I can modify this to achieve the goal with only one time execution of the code?

  try
                        {
                          [Microsoft.Office.RecordsManagement.RecordsRepository.Records]::UndeclareItemAsRecord($item);
                        
                         
                           Write-Host "Undeclaring document named " +      $item.Title                                                           
                                                     
                            $MMSField.SetFieldValue($item,$spTerm);
                         
                           $item.Update()
                                                                    
                                                                                                
                           
                        }
                       catch
                       {
                        
                         Write-Host "Could not undeclare record. ERROR: " + $_.Exception.Message
                        
                       }
                   


faye fouladi


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>