czwartek, 10 kwietnia 2014

Problem during deployment of BDC Model

First thing to check is Feature1.Template.xml. Chances are it lacks SiteUrl property. Here is example of correct xml code:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
  <Properties>
    <Property Key='SiteUrl' Value='http://...'/>
  </Properties>
</Feature>

How to hide Ribbon items

The Ribbon on the SharePoint Forms supports customization of the default tabs, groups, and controls.
In order to customize Ribbon item, you need to know the specific identifier (ID).
The IDs can be found in the CMDUI.xml file in the …\14\TEMPLATE\GLOBAL\XML directory or you can see them here: http://msdn.microsoft.com/en-us/library/ee537543.aspx
Here is the example of how to hide some ribbon items in the form’s code-behind:
protected void Page_Load(object sender, EventArgs e)
{
  SPRibbon rib = SPRibbon.GetCurrent(this);
  if (rib != null)
  {
    rib.TrimById("Ribbon.ListForm.Edit.Actions.DeleteItem");
    rib.TrimById("Ribbon.ListForm.Edit.Actions.EditSeries");
    rib.TrimById("Ribbon.ListForm.Edit.Actions.ClaimReleaseTask");
    rib.TrimById("Ribbon.ListForm.Edit.Actions.DistributionListsApproval");       
  }
}

czwartek, 21 listopada 2013

Change server name on which SharePoint is installed

It may be necessary e.g. when you create new VM with SharePoint as a copy of the existing one.
Use old stsadm tool to achieve the goal:

stsadm -o renameserver -oldservername <current name of the server> -newservername <new name for the server

poniedziałek, 18 listopada 2013

IIS configuration for debugging

ASP.NET  > .NET Compilation

Debug: TRUE
Default Language: C#

IIS > ASP

Enable Server-side Debugging: TRUE

Directly in web.config file

CallStack="true"
CustomErrors mode="Off"

Polskie znaki Ł i Ś

W pliku
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1045\FORM.js
zamienić
L_InsertCellLeftKey_TEXT=”L”   na   L_InsertCellLeftKey_TEXT=”false”
oraz
L_SplitCellKey_TEXT=”S”   na   L_SplitCellKey_TEXT=”false”

wtorek, 12 listopada 2013

Add and deploy solution with PowerShell

Add-SPSolution -LiteralPath "<path>\MySolution.wsp" | Out-Null
echo " > Adding MySolution..."
start-sleep -s 10
$sln = get-spsolution -identity MySolution.wsp
Install-SPSolution -Identity $sln -GACDeployment
while($sln.Deployed -eq $false) {
echo " > Deploying in progress..."
start-sleep -s 10
}
echo "MySolution is deployed."
Enable-SPFeature -Identity "MyFeatureName" -Url "<my site url>"

Need to know what exactly is your feature name? This command will display all web-scoped features:

Get-SPFeature | Where-Object { $_.Scope -eq "Web" } | Format-Table -Property DisplayName -AutoSize

Retrack solution with PowerShell

Set-ExecutionPolicy unrestricted
echo " "
echo "MySharepointSolution"
$sln = get-spsolution -identity MySharepointSolution.wsp
uninstall-spsolution -identity MySharepointSolution.wsp -confirm:$false
echo "Started solution retraction..." 
while($sln.JobExists) {
echo " > Working..."
start-sleep -s 10 
}
remove-spsolution -identity MySharepointSolution.wsp -confirm:$false
echo "Removed MySharepointSolution"
echo " "