Skip to main content

Posts

How to save list template in SharePoint ?

In this blog, we are going to learn, how to save the list as a template. We can save the list template with the content and without content also but there is a restriction of size for the content.

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.


5. After clicking on OK. Click on the list template gallery to view your template. You can also download that …
Recent posts

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 the cache and to clear the cache of SharePoint designer follow the steps.

Follow the steps mentioned below:
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.get_effectiveBasePermissions().has(SP.PermissionKind.deleteListItems))
{
   …

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 context = new SP.ClientContext(siteUrl); var li…

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 modern site but the content editor web part not appear on the page, to appear content editor web part on page you need to follow 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 site settings activate 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 (option mentioned on page)- Scroll the page you found option for the Custom Script.  





It will take 24 Hours to …