Friday, September 26, 2014

Stop & Start the Farm Services using powershell script

Get-SPServiceInstance | ? {$_.TypeName -eq "Search Host Controller Service"}

To Stop the Specific Instance ID
Stop-SPServiceInstance -Identity <instance ID>

To Start the Specific Instance ID

Start-SPServiceInstance -Identity <instance ID>

Monday, September 8, 2014

SharePoint - The column name you have entered is already in use or reserved - Solution


SharePoint - The column name you have entered is already in use or reserved. Choose another name
When you’re creating columns either the Site Columns or the List Columns in SharePoint, suddenly it might show a message stating “The column name that you entered is already in use or reserved. Choose another name.” 


Here is the fix for this issue.


1. Goto Site Actions > Site Settings > Modify All Site Settings
2. Under Galleries, choose Site Content Type
3. Select the content type and choose the column
4. Edit the column in new window
5. On your browser address bar, type the following and enter:
javascript:g_FieldName={};alert('Successfully cleared forbidden columns');
6. Be sure you get the 'Successfully cleared forbidden columns' alert before proceeding, if not then something is wrong.
7. Change the column name and Hit OK

Tuesday, September 2, 2014

Increasing BDC Throttle config using powershell


Error:

WCF Service Connector has throttled the response. The response from the WCF service contains more than '500000' bytes. The maximum amount of data that can be read through WCF Service Connector is '500000' bytes. The limit can be changed via the 'Set-SPBusinessDataCatalogThrottleConfig' cmdlet


Resolution:

Run the below PowerShell script in Admin Mode:

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { 
        Add-PSSnapin "Microsoft.SharePoint.PowerShell" 
    } 

$bdcProxy = Get-SPServiceApplicationProxy | where {$_.GetType().FullName -eq ('Microsoft.SharePoint.BusinessData.SharedService.' + 'BdcServiceApplicationProxy')}
$dbRule = Get-SPBusinessDataCatalogThrottleConfig -Scope Database -ThrottleType Items -ServiceApplicationProxy $bdcProxy
#Default and Maximum must be provided together. This increases the limit for external lists to 3000. 
Set-SPBusinessDataCatalogThrottleConfig -Identity $dbRule -Maximum 1000000 -Default 3000

#This disables a throttling rule. Notice the “:” instead of a space. 
Set-SPBusinessDataCatalogThrottleConfig -Identity $dbRule -Enforced:$false

#This enables a throttling rule. 
Set-SPBusinessDataCatalogThrottleConfig -Identity $dbRule -Enforced:$true

Tuesday, August 26, 2014

How to resolve the error "The operation could not be completed" in InfoPath 2010.

How to resolve the error "The operation could not be completed" when trying to create a new connection to access the SharePoint site in InfoPath 2010.

Error:

I tried to use the SharePoint List form template to access the SharePoint list (to customize the SharePoint list form) in InfoPath. In the Data Connection Wizard I entered the site collection URL (http://serverName:2020/sites/SubSite) and then clicked on the "Next" button you will get the below error.

Infopath2.jpg

Reason:

When you try to access the SharePoint site, ensure that there is a root site in the web application. For example I tried to access the site collectionhttp://serverName:2020/sites/SubSite. Ensure the root site 
http://serverName:2020 is available in the web application.

Resolution
  1. Open Central Administration.
  2. Click on Application Management.
  3. Click on View all site collections and select the web application from the drop down check whether the root site collection is available http://serverName:8080.
  4. If the root site is not available then click on Application Management and then click on Create site collection that is available under Site Collections.
  5. Create the root site and then try to create a new connection in the InfoPath form; you will be able to create it successfully.

Thursday, July 24, 2014

Configuring Workflow Manager in SharePoint 2013


Step by step process to configure the Workflow Manager for SharePoint 2013 has been defined in the  below link.

Source from: http://technet.microsoft.com/en-us/library/jj193478

Workflow Service need to be registered for each site collection level. Below Command will register the WF Service.

Register-SPWorkflowService -SPSite "SPsite URL" -WorkflowHostUri "http://servername:12291" -ScopeName "test" -AllowOAuthHttp  -Force


Enable-SPFeature -Identity WorkflowServiceStore –Url "http://ca1vmsp13dev:8005/siteCollection"

Monday, July 21, 2014

SharePoint - List of OOB Webparts

Below are the list of out of the Box Web-Parts Available in SharePoint


Web Part Category SKU Filename
Business Data Actions BCS/BI Enterprise BusinessDataActionsWebPart.dwp
Business Data Catalog Filter BCS/BI Enterprise BusinessDataFilter.dwp
Business Data Item BCS/BI Enterprise BusinessDataDetailsWebPart.webpart
Business Data Item Builder BCS/BI Enterprise BusinessDataItemBuilder.dwp
Business Data List BCS/BI Enterprise BusinessDataListWebPart.webpart
Business Data Related List BCS/BI Enterprise BusinessDataAssociationWebPart.webpart
Chart BCS/BI Enterprise MossChartWebPart.webpart
InfoPath Form BCS/BI Enterprise BrowserForm.webpart
Key Performance Indicators (Status List) BCS/BI Enterprise KpiListWebPart.dwp
KPI Details BCS/BI Enterprise IndicatorWebPart.dwp
PerformancePoint Filter BCS/BI Enterprise FilterWebPart.webpart
PerformancePoint Report Viewer BCS/BI Enterprise ReportViewWebPart.webpart
PerformancePoint Scorecard BCS/BI Enterprise ScorecardWebPart.webpart
PerformancePoint Stack Selector BCS/BI Enterprise StackWebPart.webpart
Visio Web Access BCS/BI Enterprise VisioWebAccess.dwp
Categories Navigation Standard CategoryWebPart.webpart
Content Query Content Rollup Standard ContentQuery.webpart
HTML Form Content Rollup Foundation MSSimpleForm.dwp
Picture Library Slideshow Content Rollup Foundation MSPictureLibrarySlideshow.webpart
RSS Viewer Content Rollup Standard RssViewer.webpart
SAP iView Content Rollup Enterprise
What's Popular Content Rollup Standard WhatsPopularWebPart.dwp
WSRP Viewer Content Rollup Enterprise WSRPConsumerWebPart.dwp
XML Viewer Content Rollup Foundation MSXml.dwp
Sites in Category Content Rollup Standard CategoryResultsWebPart.webpart
Current User Filter Filters Enterprise
Choice Filter Filters Enterprise AuthoredListFilter.webpart
Date Filter Filters Enterprise DateFilter.dwp
Filter Actions Filters Enterprise FilterActions.dwp
Page Field Filter Filters Enterprise
Query String Filter Filters Enterprise QueryStringFilter.webpart
SQL Server Analysis Services Filter Filters Enterprise OlapFilter.dwp
Text Filter Filters Enterprise TextFilter.dwp
SharePoint List Filter Filters Enterprise SpListFilter.dwp
Data Form Authoring Standard DataFormWebPart.webpart
Data View Authoring Foundation DataViewWebPart.dwp
Content Editor Authoring Foundation MSContentEditor.dwp
Chart View Authoring Foundation ChartViewWebPart.webpart
Image Viewer Authoring Foundation MSImage.dwp
Media Authoring Standard Media.webpart
XSLT List Form Authoring Foundation XsltListFormWebPart.webpart
XSLT List View Authoring Foundation XsltListViewWebPart.webpart
Silverlight Authoring Foundation Silverlight.webpart
Wiki Content Authoring Foundation WikiContentWebpart.webpart
Document ID Lookup Documents Standard DocIdSearchWebPart.dwp
Document Set Contents Documents Standard DocumentSetContents.dwp
Relevant Documents Documents Foundation MSUserDocs.dwp
Document Set Properties Documents Standard DocumentSetProperties.dwp
Advanced Search Box Search Standard AdvancedSearchBox.dwp
Dual Chinese Search Search Standard DualChineseSearch.dwp
Federated Results Search Standard SummaryResults.webpart
People Refinement Panel Search Standard PeopleRefinement.webpart
People Search Box Search Standard PeopleSearchBox.dwp
People Search Core Results Search Standard PeopleSearchCoreResults.webpart
Refinement Panel Search Standard Refinement.webpart
Related Queries Search Standard QuerySuggestions.webpart
Search Action Links Search Standard SearchActionLinks.webpart
Search Best Bets Search Standard SearchBestBets.webpart
Search Box Search Standard SearchBox.dwp
Search Core Results Search Standard SearchCoreResults.webpart
Search Paging Search Standard Searchpaging.dwp
Search Statistics Search Standard searchstats.dwp
Search Summary Search Standard searchsummary.dwp
Search Visual Best Bet Search Enterprise VisualBestBet.dwp
Top Federated Results Search Standard TopAnswer.webpart
Site Aggregator Navigation Standard siteFramer.dwp
Summary Links Navigation Standard
Table of Contents Navigation Standard TableOfContents.webpart
Tag Cloud Navigation Standard TagCloud.dwp
User Context Filter Social Enterprise UserContextFilter.webpart
Note Board Social Standard SocialComment.dwp
Organization Browser Social Standard ProfileBrowser.dwp
Contact Details Social Standard contactwp.dwp
User Tasks Social Foundation MSUserTasks.dwp
What's New Social Standard WhatsNewWebPart.dwp
Wherabouts Social Standard WhereaboutsWebPart.dwp
Site Users Social Foundation MSMembers.dwp
Excel Web Access Office Enterprise Microsoft.Office.Excel.WebUI.dwp
My Calendar Office Standard owacalendar.dwp
My Contacts Office Standard owacontacts.dwp
My Inbox Office Standard owainbox.dwp
My Mail Folder Office Standard owa.dwp
My Tasks Office Standard owatasks.dwp

Sunday, June 29, 2014

Hiding Actions, Setting Menu in Web part Toolbar

1. Open the Page in SharePoint Designer
2. Look for Content Editor WebPart
3. Place the below code just above the CEWP end tag(</Content>)

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function(){

$('.ms-menutoolbar td:eq(2)').hide();
$('.ms-menutoolbar td:eq(6)').hide();
$('.ms-menutoolbar td:eq(8)').hide();
$('.ms-menutoolbar td:eq(10)').hide();
}); 

</script>

Manipulate a List Form Field Using JavaScript

Below Post show the full example of the script I use to set the default value of a Lookup field based on an ID stored in the querystring. setting a Lookup field is a bit more complicated than some other field types. The reason is that Lookup FormFields are rendered with different HTML when the target list contains more than 20 items.

Here’s a partial table of SharePoint column types and their corresponding “identifiers” and “tagNames”:

SharePoint Field Type
identifier
tagName
Single Line of Text
TextField
input
Multiple Lines of Text
TextField
input
Number
TextField
input
Currency
TextField
input
Choice (dropdown)
DropDownChoice
select
Lookup (single)*
Lookup
select
Lookup (multiple)
SelectCandidate; SelectResult
select
Yes/No
BooleanField
input

SharePoint Lookup type can allow user to pick up the items from existing List, when editing the item it will show as a dropdown box (<SELECT> Element  in HTML ). Sometimes we may want to fire the onchange event when the selected item changed.  This is easy by using JavaScript to bind the onchange event to the control. First we find out the Element by <SELECT> tag and then bind the onchange to it.

Open SharePoint Designer and add above script to the page.
There is another way to add the script to the page without using SPD, go to the Edit page, on the Browser URL address bar, append ‘&toolpaneview=2’ at the end of the url and hit Enter.it will go to web part page design UI. So just add a ‘Content Editor WebPart’, click ‘Soruce Editor’ and paste above script into it.

<script type="text/javascript">

_spBodyOnLoadFunctionNames.push("PageOnLoad"); 

 function PageOnLoad() {

//find your lookupElement from the page.
     var lookupElement = GetLookupField(’Lookup Field’);
           
//because browser render Lookup field diferrent when items number below or more than 20.
//so we bind diffrent event to the Lookup.
    if (lookupElement.length < 20)
        lookupElement.onchange = function() { OnChanged () };
    else //for more than 20 items
        lookupElement.onblur = function() { OnChanged () };
   }

function OnChanged(){
      alert("Value got Changed");
}

//this function is used to get Lookup dropdown element.
function GetLookupField(elementTitle) {
    //first we try to see if it’s being rendered as <select> tag. for items less then 20
    var lookupElement = GetElementByTypeAndTitle('SELECT', elementTitle);
    //if more than 20 items, it will be render as <input>
    if (lookupElement == null)
        lookupElement = GetElementByTypeAndTitle('INPUT', elementTitle);
    return lookupElement;
}

function GetElementByTypeAndTitle(elementType, elementTitle) {
    //get the Element by tag name.
    var allElements = document.getElementsByTagName(elementType);
    for (var i = 0; i < allElements.length; i++) {
        //compare the Title.
        if (allElements [i].title == elementTitle)
            return allElements [i];
    }
    return null;
}
</script>

The above script should now be able to handle select change no matter items number < 20 or not.