Search This Blog

Total Pageviews

Thursday, September 21, 2017

Expand ALL & Collapse ALL in Sharepoint Library Group View

 <input type="button" value="Expand ALL" onclick="ProcessAll(this)"  style='color:white;background-color:darkgreen;font-weight:bold;'/>

<script>
function ProcessAll(btnobj)
{
if(btnobj.value=="Expand ALL")
{
expandAllData();
btnobj.value="Collapse ALL";
}
else
{
collapseAllData();
btnobj.value="Expand ALL";
}
}
function  expandAllData() {
$("img.ms-commentexpand-icon").click();
}
function  collapseAllData() {
$("img.ms-commentcollapse-icon").click();
}
</script>

Wednesday, September 6, 2017

Clear Your SharePoint Designer 2010/2013 Cache

Procedure:
  1. Close SPD if it is open
     
  2. Open My Computer
     
    a.Click the address bar
     
  3. Paste in:
    %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache
     
  4. Delete everything within this location
     
  5. Click the address bar
     
  6. Paste in:
    %APPDATA%\Microsoft\Web Server Extensions\Cache
     
  7. Delete everything in this location
SharePoint Designer 2010 and 2013
  1. Navigate to the "File" menu then select "Options" -> "General" -> "Application Options".
  2. On the “General” tab, under the “General” heading, uncheck “Cache site data across SharePoint Designer sessions”.

Thursday, August 10, 2017

Validate Current user Belog to Member of the Groups

 public bool VaildateUserBelogtoGroups(string[] groupNames)
        {
            bool rval = false;
            try
            {
                foreach (string grpName in groupNames)
                {
                    SPGroup ogrp = SPContext.Current.Web.SiteGroups.GetByName(grpName);
                    if (ogrp.ContainsCurrentUser && rval == false)
                        rval = true;
                }
            }
            catch (Exception ex)
            {


            }
            return rval;
        }

The above method will validate the Current user becomes the Member of Specific Groups.


Tuesday, August 8, 2017

Show Sharepoint Ribbon on page Load

<script>
setTimeout(function() {
var elem = document.getElementById("MSOZoneCell_WebPartWPQ2");
if(elem != null) {
var dummyevent = new Array();
dummyevent["target"] = elem;
dummyevent["srcElement"] = elem;
WpClick(dummyevent);
}
}, 100);
</script>

The above script will invoke the ribbon by default in IE( for the specific webpart), incase if you added multiple webparts.

Monday, July 31, 2017

Task List Not Showing in Add an App

Today i found that one of the Sub site is missing the Task List in Add an APP.


i am searching the root cause nothing i found

Then i decided to search on Site Features, there i found





Team Collaboration Lists - This Feature i Deactivated and Activated then its Showing Now... :)



Hope this may helps someone.

Wednesday, July 26, 2017

SharePoint: A Complete Guide to Getting and Setting Fields using C#

https://social.technet.microsoft.com/wiki/contents/articles/21801.sharepoint-a-complete-guide-to-getting-and-setting-fields-using-c.aspx

Wednesday, June 14, 2017

Filter and Paging For SharePoint Library

Create Calculated Column "FN" Formula =UPPER(LEFT([Title]))

Edit  all items view page -> add the following script in Script editor.

<script type="text/javascript">
    function qs(paramName) {
        var args = document.location.search.substring(1).split("&");
        for (j = 0; j < args.length; j++) {
            nameValues = args[j].split("=");
            if (nameValues[0] == paramName) return nameValues[1];
        }
        return null;
    }
    var filterField = "FN";
    var filterValuesDelimiter = " - ";
    var filterValues = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
    var selectedValueStyle = "font-weight: bold;";
    var filterDivStyle = " font-size: 15px;";
    var filterLinks = new Array();
    for (var i = 0; i < filterValues.length; i++) {
        filterLinks.push('<a ' + (qs("FilterValue1") == filterValues[i] ? 'style="' + selectedValueStyle + ' ' : '') + 'href="' + document.location.pathname + '?FilterField1=' +
            filterField + '&FilterValue1=' + filterValues[i] + '">' + filterValues[i] + '</a>');
    }
    document.write('<div class="textfilter" style="' + filterDivStyle + '">' + filterLinks.join(filterValuesDelimiter) + '</div>');
</script>
<style>
    .ms-bottompaging {
        background-color: #216288;
        width: 100%;
        color: white;
    }

 
    .textfilter {
        text-align: center;
        background-color: #216288;
        color: white;
        margin-top: -20px;
        padding: 3px 3px 3px 3px;
    }

    .textfilter a:visited {
        color: white;
    }

    .textfilter a:selected {
        color: white;
    }

    .textfilter a:link {
        color: white;
    }

    .textfilter a:hover {
        color: yellow;
    }

    .textfilter a,
    .ms-link:visited {
        color: white;
    }

   
</style>

Wednesday, June 7, 2017

SharePoint 2013 Tab Pages

Tab-Pages :
http://www.ashokraja.me/post/Easy-method-to-convert-a-SharePoint-2013-Content-Editor-WebPart-into-Tab-Pages.aspx

http://www.ashokraja.me/post/Tab-Pages-WebPart-in-SharePoint-2013-based-on-jQuery-Easy-Tabs-without-combining-multiple-web-parts.aspx

CSS Effects & Animation



Gradient Effect using CSS

https://testdrive-archive.azurewebsites.net/Graphics/CSSGradientBackgroundMaker/Default.html

Image Roll Over Effect
http://aceinfowayindia.com/blog/ace-tuts/css-rollover.html


CSS Animations
http://www.the-art-of-web.com/css/css-animation/


CSS: border-radius
http://www.the-art-of-web.com/css/border-radius/

Monday, May 22, 2017

how to set any SP.Field Value with JSOM (Javascript) Sharepoint 2013

function createListItem() {  
   var clientContext = new SP.ClientContext(_spPageContextInfo.siteAbsoluteUrl);  
   var oList = clientContext.get_web().get_lists().getByTitle('TestList');  
   var itemCreateInfo = new SP.ListItemCreationInformation();  
   this.oListItem = oList.addItem(itemCreateInfo);
  
   //Single line of text  
   oListItem.set_item('Title', 'My New Item!'); 
 
   //Single Choice  
   oListItem.set_item('PetkaChoiceDrop', 'Enter Choice #1');  

   //Multi Choice  
   var petkaChoiceMultiArray = new Array("Enter Choice #1","Enter Choice #2");    
   oListItem.set_item('PetkaChoiceMulti', petkaChoiceMultiArray);  

   //Single Lookup  
   var PetkaLookupSingle = new SP.FieldLookupValue();  
   PetkaLookupSingle.set_lookupId(2);  
   oListItem.set_item('PetkaLookup', PetkaLookupSingle);  

   //Multi Lookup  
   var lookupsIds = [1,2];  
   var lookups = [];  
   for (var ii in lookupsIds) {  
      var lookupValue = new SP.FieldLookupValue();  
      lookupValue.set_lookupId(lookupsIds[ii]);  
      lookups.push(lookupValue);  
   }  
   oListItem.set_item('PetkaLookupMulti', lookups);
  
   //Yes=1 / No=0  
   oListItem.set_item('PetkaYesNo', 1);  

   // Single Person  
   var singleUser = SP.FieldUserValue.fromUser('Peter Dotsenko');  
   oListItem.set_item('PetkaPersonSingle', singleUser);  
   
   //Multi Person  
   var petkaUserMultiArray = new Array("peterd@domain.com","Peter Dotsenko","domain\\peterd");  
   var lookups = [];  
   for (var ii in petkaUserMultiArray) {  
      var lookupValue = SP.FieldUserValue.fromUser(petkaUserMultiArray[ii]);  
      lookups.push(lookupValue);  
   }  
   oListItem.set_item('PetkaPersonMulti', lookups); 
 
   //Managed Multi  
   var field = oList.get_fields().getByInternalNameOrTitle("PetkaManagedMulti");  
   var taxField = clientContext.castTo(field, SP.Taxonomy.TaxonomyField);  
   var terms = new SP.Taxonomy.TaxonomyFieldValueCollection(clientContext,getMultiTax(),taxField);  
   taxField.setFieldValueByValueCollection(oListItem, terms);  

   //Managed Single  
   var field = oList.get_fields().getByInternalNameOrTitle("PetkaManagedSingle");  
   var taxField = clientContext.castTo(field, SP.Taxonomy.TaxonomyField);  
   var taxonomySingle = new SP.Taxonomy.TaxonomyFieldValue();  
   taxonomySingle.set_label("Mamo");  
   taxonomySingle.set_termGuid("10d05b55-6ae5-413b-9fe6-ff11b9b5767c");  
   taxonomySingle.set_wssId(-1);  
   taxField.setFieldValueByValue(oListItem, taxonomySingle);
  
   //Hyperlink or Picture  
   var hyperLink = new SP.FieldUrlValue();  
   hyperLink.set_url("http://cnn.com");  
   hyperLink.set_description("CNN");  
   oListItem.set_item('PetkaHyperLink', hyperLink);
  
   //Currency  
   oListItem.set_item('PetkaCurrency', '100');
  
   //DateTime  
   oListItem.set_item('PetkaDateTime', '3/14/2014'); 
 
   //MultiLine text  
   oListItem.set_item('PetkaMultiText', '<p><strong>Hello!</strong></p>');
  
   oListItem.update();  
   clientContext.load(oListItem);  
   clientContext.executeQueryAsync(  
     Function.createDelegate(this, this.onQuerySucceeded),   
     Function.createDelegate(this, this.onQueryFailed)  
   );  
 }

function getMultiTax(){  
      var terms = new Array();  
      terms.push("-1;#Mamo|10d05b55-6ae5-413b-9fe6-ff11b9b5767c");  
      terms.push("-1;#Popo|178888b0-7942-45bb-b3f1-2f38d476e3db");  
      return terms.join(";#");  
}

function onQuerySucceeded() {
    SP.UI.Notify.addNotification('Item created: ' + oListItem.get_id());
}

function onQueryFailed(sender, args) {
    console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

Friday, April 28, 2017

Why SharePoint Online is a much smarter choice than SharePoint On-Premise!

Security, is way tighter in SPO infact – and some features do not even exist in SP On-Premise.

For instance, with SPO:

1.     You get the ADFS integration – which means, you can take advantage of the ADFS features & security policies, location based control for SPO as well
2.     RMS – Rights Management Services – Azure RMS – is pre-configured in SPO and supports file types such as MS Office, PDF files, Images too – and all you need is the Azure Information Protection Client to view the protected files
3.     You get DLP (Data Loss Prevention) which is only available with SPO and I have created a presentation for this here – Have a look and using this, we can prevent confidential content such as documents containing patents, SSN numbers or SWIFT Codes or IP Addresses can be protected from going out
4.     SPO Content has multiple times encrypted and hence, the content is way secure than you can imagine
5.     On top of it, you can even prevent SPO Sites from being accessed through certain IP Addresses, prevent content from being accessed on Mobile Devices etc. – all of that through the OneDrive Admin Center: this is detailed here.
6.     All actions are audited and you can track downloads, files being accessed, files being edited – in https://protection.office.com – something that you don’t have with SP On-Premise!

You can do the below here:
·         Manage external sharing
·         Set the default storage space

All of the above are so unique to SPO that, you just don’t get them in SP On-Premise. Thus, SPO is the way to go!

With Infra requirements, ofcourse, you do not need to plan for servers, capacity planning, sizing, connectivity, Disaster Recovery, Backup etc and all of that is available instantly

For workflows, Nintex can be eliminated with Custom Built Workflows and this is something I have briefed about in my SoW. HTML mails is not a concern at all!

On top of it, we have tools like Microsoft Flow: using which we can spin up no code workflows that can pull / push data with SPO – from Other Business Applications, Other O365 Applications, Social Applications etc. for instance, a FB Post, can add a SPO List Item! – and without writing any code! – Your marketing teams will love this…
Check all SPO Actions here

SPO Natively – with the modern Team Sites UI, are Responsive Design by default and hence will give a very smooth and convenient interface.
With more and more people accessing content over Mobile, you just cannot ignore this user base!

With the new SharePoint Online Framework, it allows you to create WebParts that take advantage of CDN – Content Delivery Network – where the JS, Images – assets related to your code are stored! – CDN automatically chooses the nearest O365 Data Center to render your assets and hence the SPO Sites render much faster. Read more here

SharePoint Online Usage Analysis feature is another one, that is unavailable with SP On-Premise. Infact, there is no roadmap to introduce elaborate Usage Analytics on SP On-Premise. With SPO, you have it right now! – This is so important, as you can clearly see your usage trends, top users, top sites, top documents and much more!

On top of all of these, you have the integration with:

1.     Microsoft Delve  - to automatically bring in relevant content from SPO and OneDrive
2.     SharePoint Mobile App from MS – to see SPO Sites from the mobile app itself on the go
3.     Microsoft PowerApps Integration – for you to create cross platform mobile apps from your SharePoint content, for example, you can create a field engineer app – to collect service incidents on the app and have it stored on SPO Lists!
4.     Microsoft Power BI Integration – for you to create dashboards out of your SPO Lists. For instance, you record say, a set of invoices on SPO, you can create a visual dashboard in Power BI using this data


Thus, holistically speaking and considering, SPO is a much smarter choice for any organization as they embark on the SP strategy!