Skip to main content

Posts

What is developer site in SharePoint

Developer site is used by a Visual Studio for deploying and developing the app. You do not need the app catalog site to deploy the solution on developer site because the developer site by default creates an app catalog. When you try to deploy add-in on non-developer site you got " Sideloading of apps is not enabled on this site " and to resolve this you need to enable app sideloading feature on the site. How to create developer site :  1. Login in your office 365 credentials and move to office 365 admin center and click on the SharePoint. 2. Now you are at SharePoint admin center by default you are at site collections section. Click on      new – Private site collection . 3. Now fill the Title, Web Site Address and select the   Develoepr Site in template section, selcet time zone and give the name of the Administrator of the site. You can also fill the resource quota, if you want and click on the OK. 4. You can check y...

System Update in SharePoint.

When we write code to update the SharePoint list item, we use the Client-side object model or Javascript object model. When we write the code we get two options for updating the list item  update()  and  systemupdate(). update vs system update SharePoint? update() method : When we use the update() method it updates the "Modified"  and "Modified By" column and if the Versioning option is enabled then it also updates the version column. systemupdate() : When we use systemupdate() method. this method did not update the   "Modified"  and  "Modified By"  column and Version. So when you do not want to update these columns while updating use the systemupdate() method. Let's view the code written in Jsom to update the item using the systemupdate (). function updateItem() { var clientContext = new SP.ClientContext('enter your site url'); var oList = clientContext.get_web().get_lists().getByTitle('enter title of your list...

How to save list as template in SharePoint

In this blog, we are going to learn, how to save the list as a template. We can save the list as template with the content and without content but there is a restriction of size for the content. List template are provide us flexibility to recreate list with same structure. Using this list template we can create a list with the same structure(same column name and same type) anywhere we wanted to. In Modern SharePoint, we need to enable custom scripting to view this option. Please follow these steps to save the list as a template. 1. Navigate to your target list which you want to save as a template. 2. Click on the List setting . 3. Now click on the Save list as template. 4. Now give a file name and template name, you can also check the include content option if you want to save the template with content but there is a limit for the content size and if you want to save the template without content do not check the include content option and click on OK . ...

How to clear sharepoint designer cache?

SharePoint designer may not work as expected, sometimes when you try to connect with the SharePoint site and you face the issue also when you try to create SharePoint designer workflow you may get some issue. To correct this SharePoint designer error you need to clear SharePoint Designer cache, follow: Press window key + R and paste the location one by one. 1. %APPDATA%\Microsoft\Web Server Extensions\Cache 2. %APPDATA%\Microsoft\SharePoint Designer\ProxyAssemblyCache 3. %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache 4. %APPDATA%\Microsoft\SharePoint Designer Once you remove clear the cache and restart the SharePoint designer, it starts working and if still not worked. You need to check this blog  SharePoint designer  error. Happy coding!!!!!

How to check which permission user have on the list.

In this blog, we are going to learn how to check the permission of the user on the list. Some times we need to show and hide several things as per the permission assigned to the user. SharePoint has different permission levels. We are using the function of "sp.js", to use function of sp.js we need to include the sp.js file. In this example, we are checking for the delete permission. SP . SOD.executeFunc('sp.js', 'SP.ClientContext', function () {      checkPermssion(); }); function checkPermssion(){ var web,clientContext,currentUser,oList; clientContext = new SP.ClientContext.get_current(); web = clientContext.get_web(); currentUser = web.get_currentUser();     oList = web.get_lists().getByTitle(' List Title');  clientContext.load(oList,'EffectiveBasePermissions');  clientContext.load(currentUser);   clientContext.load(web);             clientContext.executeQueryAsync(function(){  if (oList....

How to check whether list item contains attachment or not using code.

To check whether the list item contains the attachment programmatically or using CSOM. Get the list item collection and then check for the attachment column. List listEvent  = web.Lists.GetByTitle(listName); clientContext.Load(listEvent, L => L.Id); CamlQuery camlQuery2 = new CamlQuery(); camlQuery2.ViewXml = "<View><Query></View></Query>"; ListItemCollection item_Coll = listEventSource.GetItems(camlQuery2); clientContext.Load(item_Coll); clientContext.ExecuteQuery(); foreach (ListItem oLstItem in item_Coll)   {   bool attachmentPresent = Convert.ToBoolean(oLstItem["Attachments"]);   if (attachmentPresent)     {             Console.WriteLine("Item is present");     }    } Happy Coding !!!!!

How to hide the left navigation in team sites

In the modern team site in SharePoint navigation section is come by default, If you want to hide the left navigation in the modern team site. To hide the section, follow the steps . 1 .  Navigate to the team site, and click on the gear icon . 2 . After clicking on the gear icon, click on the site information. 3 .  On clicking the site information, "edit site information" box appears. Scroll down and click on the View all site settings. 4 .  On clicking the view all site settings, site settings appear, click on the Navigation Elements. 5 .  On clicking Navigation Elements, uncheck the options. 6 . Uncheck the options and click on OK. 7 .  Now the Left navigation is disappeared from your site. Enjoy... SharePoint.

Retrieve List Items using JSOM.

To return or get items from the list you have two options if you want to retrieve the single item you can use the GetItemById() method or for multiple items use GetItems(CamlQuery). Replace the siteUrl with your siteUrl for example ("xyz.sharepoint.com") and TitleOfList with your title list from which you want to get the items. Code to get the list item using the ID.  function getListiem(){ var context = new SP.ClientContext(siteUrl);  var list = context.get_web().get_lists().getByTitle('TitleOfList');  var targetListItem = list.getItemById(listItemID); context.load(targetListItem); context.executeQueryAsync(onGettingRecord, onFailedCallback); } function onGettingRecord(){ alert(targetListItem.get_item('Title')); } function onFailedCallback(sender,args){ alert('Request failed. ' + args.get_message() + '\n'+args.get_stackTrace()); } Code to get multiple items from the list. function getItems(){ var...

Content editor web part missing in SharePoint/Modern SharePoint.

Media and content editor web part missing in SharePoint online. At Some Point, you need to add content editor web part into the modern site but the content editor web part did not appear on the page, to appear content editor web part on page you need to follow the below steps. 1 Log in as the SharePoint Global Administrator or SharePoint Administrator. 2.  Log in and navigate to your site collection ("https://xyz.sharepoint.com") and under the site settings activate the below features.   Site settings – site features – SharePoint Server Publishing .   Site Settings – Site Actions – Manage site features- SharePoint Server Publishing Infrastructure.                For this, you also need to enable Custom site scripts on your site collection(But In Modern SharePoint Its not recommended to enabling custom site scripting)  For this go to the  SharePoint Admin center – Settings -  Classic settings page (op...

Update SharePoint list item using JSOM.

In this blog, we are going to learn how to update the SharePoint list item using the JSOM. To update the SharePoint list item or delete it, we can do this using the help of item id. Here we are performing an operation on the list named "Info", which have two columns "Name" and "Address".  Replace "***.sharepoint.com" with your tenant URL and replace the ListItemID with your item id. var clientContext = new SP.ClientContext('***.sharepoint.com'); var oList = clientContext.get_web().get_lists().getByTitle('Info'); var oListItem = oList.getItemById(listItemID); oListItem.set_item('Name','xyz');  oListItem.set_item('Address','xyz');  oListItem.update(); clientContext.executeQueryAsync(Function.createDelegate(this, this.ItemUpdate), Function.createDelegate(this, this.onQueryFailed)); function ItemUpdate(){ alert('Item updated'); } function onQueryFailed(sender,args){ alert('...