Skip to content

Instantly share code, notes, and snippets.

View devendrasv's full-sized avatar

Devendra Velegandla devendrasv

View GitHub Profile
@devendrasv
devendrasv / App.js
Created January 11, 2013 00:32
basic-App.js
var context;
var web;
var user;
// This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model
$(document).ready(function () {
context = SP.ClientContext.get_current();
web = context.get_web();
getUserName();
@devendrasv
devendrasv / Elements.xml
Last active December 11, 2015 04:18
site column Elements.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field
ID="{779bdd44-c459-49cd-8265-3190420c7633}"
Name="Team_x0020_Name"
DisplayName="Team Name"
Type="Text"
Required="FALSE"
Group="Custom Site Columns">
</Field>
@devendrasv
devendrasv / Elements.xml
Last active December 11, 2015 05:28
Content Type Elements.xml file
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Item (0x01) -->
<ContentType ID="0x0100118703F0484042118516B33BD9488ECB" Name="ContentType-Object Model" Group="SharePoint-Journey" Description="My Content Type" Inherits="TRUE" Version="0">
<FieldRefs>
<FieldRef ID="{a4a8c94a-6a0d-4ef2-880d-a049720e2a73}"
DisplayName="Team Name"
Required="TRUE"
Name="Team_x0020_Name" />
<FieldRef ID="{2f6753f2-1584-477a-868e-d75ead1aaa07}"
@devendrasv
devendrasv / List Instance Elements.xml
Created January 17, 2013 01:22
List Instance Elements.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="TeamDetails"
OnQuickLaunch="TRUE"
TemplateType="10000"
Url="Lists/TeamDetails"
Description="My List Instance">
</ListInstance>
</Elements>
@devendrasv
devendrasv / correlation Id.ps1
Created January 23, 2013 14:53
get error details using powershell
get-splogevent -starttime (get-date).addminutes(-20) | where-object { $_.correlation -eq "e434f79b-68bb-40d2-0000-03a47eae1bf9" } | fl message > c:\errors1.txt
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
namespace SharePoint_webpart.Projects
@devendrasv
devendrasv / webpart-element.xml
Created January 28, 2013 15:09
webpart-element.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="Projects" List="113" Url="_catalogs/wp">
<File Path="Projects\Projects.webpart" Url="SharePoint-webpart_Projects.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="Custom" />
</File>
</Module>
</Elements>
<?xml version="1.0" encoding="utf-8"?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="SharePoint_webpart.Projects.Projects, $SharePoint.Project.AssemblyFullName$" />
<importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">SharePoint-webpart - Projects</property>
@devendrasv
devendrasv / complete-projects.cs
Last active December 11, 2015 20:39
Complete Solution
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
namespace SharePoint_webpart.Projects
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Data;