Say you have a drop down list defined as a select tag:
<option value="3" selected>Three</option>
You can very easily disable the drop down list with jQuery by adding a disabled property to the tag.
However, in doing that, the selected value of the drop down list is no longer posted back on a form submit. And some systems (such as SharePoint) may then persist the default value when saving changes, which in the example above is “1” instead of the selected “3”.
So instead of a straight forward disable, we’re forced to do some extra work to make sure the control remains disabled on the front end to the user, but still posts back the corrected selected value to the back end.
When renaming document sets in code, it needs to be done in the same way as renaming folders.
You can’t just change the Title, you’ll need to change the Name value as well, otherwise the document set / folder name remains the same.
When trying to update a workflow task item in code, you may get the error “This task is currently locked by a running workflow and cannot be edited.”
This error gets thrown because the ows_WorkflowVersion of the task list item has been set to 512.
There may be a good reason it’s set to locked (i.e. currently being updated) but it you really really want to still update the task, you can override the flag.
PowerShell can be very useful to quickly write up a script when you need to say update a field value for items in a list.
But what happens if your list happens to have 100,000+ items? Doing SPList.Items is going to get throttled.
And while PowerShell doesn’t have an equivalent for the ContentIterator class (which can iterate through large data sets while avoiding throwing a SPQueryThrottledException), we can run custom code through PowerShell that utilizes ContentIterator.
The script below does a simple field update for items of a specific content type in a list.
When trying to delete a site column, you may get the error “Site columns which are included in content types cannot be deleted. Remove all references to this site column prior to deleting it.”
This simply means that the site column needs to be manually deleted from content types before it can be properly removed.
You may have already manually done so on all content types you know of that refers to the site column, but the error still persists.
This is because it not only needs to be deleted from content types on the site collection level, but on all site level content types as well!