Podemos usar la función "Remove" para eliminar al ultimo caracter de nuestro texto: myText = myText.Remove(myText.Length - 1, 1); Por ejemplo, si queremos eliminar si el ultimo caracter de nuestro texto es una coma: if(myText.EndsWith(",")) { myText = myText.Remove(myText.Length - 1, 1); }
Etiqueta: delete
Eliminar una columna de todas las listas via Power Shell
Puede ocurrir que al crear una Site Column y agregarla a un Content Type, nos hayamos equivocado en algún parámetro (el campo Required, por ejemplo). Hemos decidido borrar la columna y para ello la borramos del Content Type y procedemos a eliminarla de las columnas de sitio. No obstante, si tenemos listas que utilicen ese …
Sigue leyendo Eliminar una columna de todas las listas via Power Shell
Error: Field type ‘XXX’ is not installed properly. Go to the list settings page to delete this field
Normalmente suele producirse cuando desplegamos una columna de sitio errónea y la modificamos. Para resolverlo debemos buscar ese campo en la base de datos de contenido y borrarlo. Lo encontramos con: SELECT * FROM [CONTENT_DB].[dbo].[ContentTypes] WHERE Definition Like '%COLUMN_GUID%' Y lo borramos con: DELETE FROM [CONTENT_DB].[dbo].[ContentTypes] WHERE Definition Like '%COLUMN_GUID%' En ambos casos debemos escribir el …
Eliminar una App de SharePoint via Power Shell
1. Abrimos la SharePoint Management Shell. 2. Ejecutamos el comando que nos obtiene la app, ya sea por nombre o por identificador: $app = Get-WmiObject -Class Win32_Product -Filter "Name='MY APP NAME'" $app = Get-WmiObject -Class Win32_Product -Filter "IdentifyingNumber='MY APP ID'" 3. Ejecutamos el comando que la desinstala: $app.Uninstall()
Borrar DLL de la GAC sin GACUTIL
En ocasiones podemos encontrarnos con situaciones en las que no se nos actualizan las DLL de la GAC y no podemos borrarlas. Nuestro primer intento sería utilizar el comando GACUTIL: http://idttechblog.wordpress.com/2014/09/25/borrar-dll-de-la-gac/ El problema es que si estamos en un entorno de producción no deberíamos tener instalado Visual studio (ante todo, buenas prácticas) por lo que no …
Borrar DLL de la GAC
El método correcto de borrar DLLs de la GAC es el siguiente: 1. Abrimos la consola de Visual Studio (Developer Command Prompt for VS2013 en el caso de Visual Studio 2013). 2. Navegamos hasta el directorio donde están nuestras DLL (cd C:WindowsMicrosoft .NETassemblyGAC_MSIL). 3. Ejecutamos el siguiente comando: gacutil -u NOMBRE_DE_MI_DLL Ejemplo (Borrar la DLL …
Mount VHD from Command Prompt
Mount VHD: DISKPART SELECT VDISK FILE="D:MyVHDDisk.vhd" ATTACH VDISK Dismount VHD: DETACH VDISK
Delete SharePoint Page Programmatically
SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite("YOURSITE")) { using (SPWeb web = site.OpenWeb()) { //Obtain the page PublishingPageCollection publishingPages = PublishingWeb.GetPublishingWeb(web).GetPublishingPages(); PublishingPage page = publishingPages.FirstOrDefault(f => f.Uri.AbsoluteUri == "YOURPAGE"); if (page != null) { //Allow modifications bool webAllow = web.AllowUnsafeUpdates; web.AllowUnsafeUpdates = true; SPFile file = page.ListItem.File; //Delete file.Delete(); //Restablish default permissions web.AllowUnsafeUpdates = …
Edit SharePoint Page By URL
If we couldn't acces to the menu item "Edit Page" for any reason and we want to edit that page (e.g. to remove some webpart that blocks our page) we've to add one parameter at the end: contents=1 Then, the URL would be like this: http://misyte.com/mysubsite/Pages/default.aspx?contents=1 By dong this we'll access to a standard SharePoint …
Remove HREF attribute from any link with JQuery
You can remove any href that contains specific text inside the link. If you want to remove the link to any page that contains "DispForm" you can do it like this: $('a[href*="DispForm"]').removeAttr("href"); '*=' means 'Contains', but you can use anything you need: *= Contains = Equal != Not equal ^= Starts With $= Ends With