Posts

Showing posts from November, 2016

Change anchor link url in sharepoint calender

here am unsing sharepoint calender to display events. The calender list is inhereted from event content type. for every event there are several columns like event name, event link(URL), Event Date...etc. for some events there may be some url in link column some may be empty. So in calender if i click the event, suppose if that event has the LINK with url then i have to redirect to the new url, if the link url is empty then i have to redirect to the event url. here when am clilcking on anchor tag in calender am calling a rest api function to get the link value of that event. am checking the link value , if value in null then am redirecting to event details and the value is not null then am redirecting to the link which am get from rest api call. here am using two mail functions which are 1)e.stopPropagation(); means it will stop the redirecting value which is assigned initially. 2)e.preventDefault(); means it will stop the default value of the anchor tag href value.

Delete First n records from sharepoint online list

Here i have a custom list with few views. In perticular view display am getting list threshhold problem. So my requirements is that when the items in list is crossing 4990 then immediatly i need to delete first 100 records from the list. first here am getting the total records in the list, then if the cound is greter then 4990 then am getting first 100 records. then am looping each record for deletion. so i will not get list thresh hold prolem for my view. here am using sharepoint cleint object model to perform this operations for sharepoint online. I think this same code will work for onpremises also. so for logging into sharepoint online it will not accept direct password. we need to convert our password as securestring. so here am using GetPasswordFromConsoleInput() funtion for converting my login password to convert as secure string and then am passing this secure string to SharePointOnlineCredentials() method. here am used console application todo this task.

Delete First n records from sharepoint online list using Powershell

Here i have a custom list with few views. In perticular view display am getting list threshhold problem. So my requirements is that when the items in list is crossing 4990 then immediatly i need to delete first 100 records from the list. first here am getting the total records in the list, then if the cound is greter then 4990 then am getting first 100 records. then am looping each record for deletion. so i will not get list thresh hold prolem for my view. here am using sharepoint cleint object model to perform this operations for sharepoint online. I think this same code will work for onpremises also. so for logging into sharepoint online it will not accept direct password. we need to convert our password as securestring. so here is my code. Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\1