jueves, 24 de mayo de 2012

Tips /Info # 26 Sharepoint 2010

1-Ocultar la opción “Download a copy” de la ribbon

<style>
A[id$='Ribbon.Documents.Copies.Download-Large'] {
    DISPLAY: none
}</style>

2-Cambiar la URL de un site collection

Sharepoint 2010 no dispone de un mecanismo para cambiar la url de un site collection. Lo que se debe hacer es hace run backup y restore del site collection

Backup-SPSite -Identity http://sharepoint/sitios/originalsite -Path c:/backupsite
Remove-SPSite -Identity http://sharepoint/sitios/originalsite
Restore-SPSite -Identity http://sharepoint/sitios/nuevossite -Path c:/backupsite

3-Query: cantidad de items agrupados por lista

select webs.Title,webs.FullUrl, tp_Title,UserDataCount,DocsCount
from AllLists left outer join
(select tp_ListId, COUNT(*) as UserDataCount from AllUserData
group by tp_ListId ) E On E.tp_ListId = AllLists.tp_ID
left outer join
(select ListId, COUNT(*) as DocsCount from dbo.Docs
group by ListId ) P ON AllLists.tp_ID = P.ListId
left outer join Webs ON AllLists.tp_WebId = Webs.id
order by DocsCount desc



UserDataCount : cantidad de registros almacenadps en la tabla AllUserData para la lista. (item borrados no se incluyen)
DocsCount : cantidad de registros almacenadps en la tabla AllDocs para la lista

(item borrados no se incluyen)

4-Error 404 al atachar (Attach) una base de contenidos


Suele pasar el problema cuando removes la base de contenido desde la UI del Central Administration, desde ese momento no podrás atachar más base de contenidos desde la UI. Se puede realizar mediante powershell:


Detach content database:

Dismount-SPContentDatabase “nombre de la base de contenido”

Attach content database:

Mount-SPContentDatabase “nombre de la base de contenido” -DatabaseServer “nombre o alias del sql server” -WebApplication http://webapplicationURL

5-Setear el outgoing mail para un Web Application mediante powershell

Set-SPWebApplication -Identity http://webapplicationURL -OutgoingEmailAddress mail@email.com –SMTPServer smtp.server.com

6-Columna lookup en CAML Javascript Client Object Model

Prestar atención el atributo LookupId
var list = web.get_lists().getById('<Projects List GUID>');
var query = '<View Scope=\'RecursiveAll\'>'+
'<Query>'+
'<Where>'+
'<Eq>'+
'<FieldRef Name=\'Cliente\' LookupId=\'TRUE\'/>' +
'<Value Type=\'Lookup\'>' + chosenoption.value +'</Value>'+
'</Eq>'+
'</Where>'+
'</Query>'+
'</View>';
7-Error “Unable to process the request” al usar Excel Services
Este error se debe a un error de comunicación con el servicio de excel, haga un iisreset.

8-Verificar si una lista existe o no mediante Server Object


SPList myList = SPContext.Current.Web.Lists.TryGetList(“ListaAVerificar”);
if(myList!=null)
{
    // existe lista
}

9-Error: “The Maximum number of webparts for all zones on this page has been exceeded“

Por default, el límite máximo de web parts por páginas aspx es de 50.


Si desea elmininar un web part podrá hacerlo mediante el querystring contents=1,nos ofrecerá la página de mantenimiento.


10-Error “Cannot find property named PROPERTYNAME on activity type ACTIVITYNAME” al diseñar una actividad de workflow custom


Cierre Sharepoint Designer y borre el contenido de las siguientes carpetas:


C:\Users\<username>\AppData\Local\Microsoft\WebsiteCache


C:\Users\<username>\AppData\Roaming\Microsoft\SharePoint Designer

No hay comentarios:

Publicar un comentario