Hot answers tagged

3

The is no password for list email addresses because they are no associated with AD user accounts. There is also no inbox because these are not Exchange email addresses. List email addresses act more like identifiers for the lists so SharePoint knows where to direct and store incoming email messages. You should have a connector in Exchange that routes emails ...


3

This code should work: (web is a variable that references the web object) SPFieldUserValue value = new SPFieldUserValue(web, item["AssignedTo"].ToString()); if (value) { assignToUser = value.User; }


2

One way is to create your filtered view on your source list. Then go to Site Settings and click on Content and Structure. This will take you to a screen with a hierarchy of your site. Click on your source list and switch to your view. Select the items you want, and in the ribbon select from the Actions drop down Copy (or Move, I'd suggest Copy to make ...


2

You can try below code to get SPUser in AssignedTo columns for specific item. If(task["Assigned To"] != null) { string fieldValue = Convert.ToString(task["Assigned To"]); SPFieldUserValue assignedTo = (SPFieldUserValue) task.Fields["Assigned To"].GetFieldValue(fieldValue); }


2

Try this SPFieldUserValue userField = item.Fields["AssignedTo"] as SPFieldUser; string userName = item["AssignedTo"].ToString(); SPFieldUserValue fieldValue = (SPFieldUserValue)userField.GetFieldValue(userName); SPUser user = fieldValue.User; Taken from http://ethan-deng.blogspot.com/2013/03/get-spuser-from-user-column-there-are.html


2

You can try below code, using (SPSite siteCol = new SPSite("http://server/sites/Contoso")) { using (SPWeb web = siteCol.RootWeb) { SPList list = web.GetList("/sites/Contoso/Lists/Books"); SPListItem item = list.GetItemByIdSelectedFields(3, "Title", "ISBN", "Retail_x0020_Price"); String bookISBN = ...


1

I finally found the answer! adding these two lines to the top of my script worked. $w = Get-SPWebApplication -Identity https://mysharepoint.org $w.GrantAccessToProcessIdentity("domain\my_username") Full script: $s = New-PSSession -ComputerName mysharepoint.org Invoke-Command -Session $s { Add-PSSnapin "Microsoft.SharePoint.PowerShell" $w = Get-...


1

PowerShell is the way to go. The following will parse 500 items at a time into the recycle bin and then remove them from the recycle bin. I've used this on lists up to 700k items. # Enter your configuration here $siteUrl = "http://sitecollectionurl" $listName = "Name of List" $batchSize = 500 write-host "Opening web at $siteUrl..." $site = new-object ...


1

It is not totally clear whether you want to write the value to the list or just display the value. So here is another solution which only displays the value without actually writing it to the list: ExecuteOrDelayUntilScriptLoaded(sum, "inplview.js"); function sum(){ ReRenderListView_old = ReRenderListView ReRenderListView = function(ctx){ ...


1

You can get total of the current view from ctx.ListData.Row. var total = 0; ctx.ListData.Row.forEach(function(item) { total += item["column1"]; }); Then update the column2 using REST API function updateItem(url, oldItem, newItem) { $.ajax({ url: _spPageContextInfo.webAbsoluteUrl + url, type: "PATCH", headers: { ...


1

You can use Infopath or Client Side Rendering (JS Link) for hiding the columns of the SharePoint List. for better understanding follow this blog using CSR https://code.msdn.microsoft.com/office/CSR-code-samples-11-Fully-54ebcaa6 To understand CSR well, you can follow this link Client-Side Rendering/JS Link documentation?


1

Nothing wrong with using JavaScript. Almost everything in SharePoint (frontend-wise) is handled with JavaScript anyway. And it would be, by far, the fastest way to do it. SPUtility.js would be a good candidate for a library that brings all the functions you need: https://github.com/kitmenke/sputility


1

You can remove the list using PowerShell: $web = get-spweb -Identity http://spsiteurl $list = $web.lists["list name"] $list.AllowDeletion = $true $list.Update() $list.Delete()


1

To get the last record of the list you have to take Ascending='False' in CAML Query. <OrderBy> <FieldRef Name='EnquiryNumber' Ascending='False' /> </OrderBy> <RowLimit>1</RowLimit>


1

Sounds like Alerts are turned on for the list. You can check the subscriptions by going to the Manage Alerts page. You can navigate there by going to: Site Settings > Site Administration > User Alerts The address though is just YOURSITEURL/_layouts/15/sitesubs.aspx



Only top voted, non community-wiki answers of a minimum length are eligible