Tag Info

New answers tagged

0

I think fallout's answer partially answers the question. His 'if statement' checks if items exist, then updates items if they exist, otherwise it creates new items if they do not exist. Depending on your columns, the trick is to update only those items that have changed in the CSV file (required for efficient version control in the sharepoint list).


0

The ItemCount function could be applied to List resource, for example: /_api/web/lists/getbytitle('<list title>')/ItemCount but not to ListItemCollection resource You could consider the following options of getting items count for list items: Option 1 How to return items count from json result: var endpointUrl = ...


0

When you query /_api/web/Lists/getbytitle(\'Items\') basically it returns SPList object. That object as ItemCount property. The value of the ItemCount property includes folders within a list/document library, as well as items/files within subfolders. For filtering we need to apply filter on Items so query ...


0

Your code is not working because the event is attached only to elements that are loaded into DOM. Dialog is generated dynamically. Hence we need jQuery to attach click event to element having style ms-dlgCloseBtn whenever it gets loaded to DOM jQuery('.ms-dlgCloseBtn').live('click',function() { alert('test'); });


1

Inorder to display error message you need to make few updates in you application web configuration file. <safeMode> tag should be set as <SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false"> <customErrors mode="On" defaultRedirect="/_layouts/error.aspx" /> Now ...


0

As the processing of the after event also fires on a different thread it is also not possible to redirect to a different page from within the after event as neither the HttpContext object from the request initiating the original operation is available nor is it guaranteed that the after event is executed before the response of the original request has been ...


1

I don't think so. ItemUpdated is asynchronous, so by the time it fires, a response has already been sent back to the browser. If you do not have access to the HTTP Request and Response, you can't tell the browser to redirect.


1

You can use SharePoint web services. Below is the snippet I copied from http://stackoverflow.com/questions/22450717/add-and-update-single-item-in-sharepoint-list-via-vba Sub Add_Item(ListName As String, SharepointUrl As String, ValueVar As String, FieldNameVar As String) Dim objXMLHTTP As MSXML2.XMLHTTP Dim strListNameOrGuid As String Dim strBatchXml As ...


0

Instead of using SPFile object use the SPListItem in foreach loop. And within the loop we can use the File property of SPListItem to get the SPFile object. Try the below code... foreach (SPListItem item in items){ SPFile file = item.File; if(docmanager.getFileExtension(item) == ".pdf"){ if (file.LockId != null){ ...


1

SPListItemCollection is a collection of SPListItem. Get File object from SPListItem. Example: foreach (SPListItem item in items) { SPFile file = item.File; }


2

You can get Distinct values for email column from your SharePoint list using below mentioned code. i had showed how to insert the distinct email values in drop down list. you can change the code accordingly. try { SPList oList = SPContext.Current.Web.Lists["Your List Nmae Here"]; SPQuery query = new SPQuery(); query.Query = "<OrderBy><FieldRef ...


1

I don't know if it is possible with CAML, but this should work: var emails = List.getItems(querysp).OfType<SPListItem>().Select(item => "" + item["email"]).Distinct();



Top 50 recent answers are included