Tag Archives: SharePoint Short

Get List Items by Field Value

SharePoint Short #6 To retrieve all SPListItem objects that have a specified field value, instead of writing a CAML query, use the following LINQ statement: public List<SPListItem> GetItemsContainingValue(SPList list, Guid fieldId, string match) { List<SPListItem> matchingItems = (from SPListItem listItem … Continue reading

Posted in SharePoint Shorts | Tagged , | 2 Comments

Disable SharePoint PeopleEditor

SharePoint Short #5 If you have a requirement to disable the PeopleEditor in SharePoint through JavaScript, the following script will do this for you: function togglePeopleEditor(editor, enable) { // Disables the control but still allows the user to type into … Continue reading

Posted in SharePoint Shorts | Tagged , | Leave a comment

Get SharePoint Timer Job Name

SharePoint Short #4 As a follow up to my recent post Start SharePoint Timer Job Script, that demonstrates how to start a specific timer job by it’s internal name, the following is a PowerShell script for retrieving the internal name … Continue reading

Posted in SharePoint Shorts | Tagged , | Leave a comment

Security Trim SPNavigationNode

SharePoint Short #3 To have the URL specified by a SPNavigationNode security trimmed, make sure you do not specify the isExternal constructor parameter. Obviously, specifying true for this parameter would not apply security trimming against the link, as you would … Continue reading

Posted in SharePoint Shorts | Tagged , | Leave a comment

Save Conflict

SharePoint Short #2 In event receivers such as ListAdded, FieldAdded or ItemAdded, if you’re updating the newly created item you may encounter the following error: “Save Conflict” These events are asynchronous by default, so changing them to synchronous will ensure … Continue reading

Posted in SharePoint Shorts | Tagged , | Leave a comment