Posts

Showing posts from September, 2012

List Join operation in SharePoint 2007 / 2010

Approach  1 private   static   void  FetchAllListsDataJoinUsingLinq() {      using  ( SPSite  _spSite =  new   SPSite ( "<Site Url>" ))     {          using  ( SPWeb  web = _spSite.OpenWeb())         {              SPList  placeList = web.GetList(web.Url +  "/lists/TouristPlace" );              SPQuery  ospPlaceQuery =  new   SPQuery ();              DataTable  dtPlace = placeList.GetItems(ospPlaceQuery).GetDataTable();              SPList  cityList = web.GetList(web.Url +  "/lists/City" );              SPQuery  ospCityQuery =  new   SPQuery ();              DataTable  dtCity = cityList.GetItems(ospCityQuery).GetDataTable();              SPList  countryList = web.GetList(web.Url +  "/lists/Country" );              SPQuery  ospCountryQuery =  new   SPQuery ();              DataTable  dtCountry = countryList.GetItems(ospCountryQuery).GetDataTable();              List < TouristPlaceDetails > joinD

SharePoint List Template Id’s

http://mosshowto.blogspot.in/2009/04/sharepoint-list-template-ids.html

SharePoint 2010 Client Object Model: Introduction

http://www.codeproject.com/Articles/399156/SharePoint-2010-Client-Object-Model-Introduction

How to run .exe on a Web Page

<script> function LaunchApp() { if (!document.all) { alert ("This ActiveXObject is only available for Internet Explorer"); return; } var ws = new ActiveXObject("WScript.Shell"); ws.Exec("D:\\yourfile.exe"); } </script> More Info http://codereflex.net/how-to-run-exe-on-webpage/

Common list operations in SharePoint 2010

Image
This below link is a good blog for SharePoint i have ever seen. Nice Keep posting http://www.sharepointkings.com/search/label/Object%20Model Thanks. i picked up some snaps from the above link for my reference. 1) How to add validation for the field in the list 2).    How to add list validation 3).  How to add referential integrity (cascading delete or cascading restrict) to the relationhip list

Modify NewForm.aspx and EditForm.aspx in Moss 2007

1.Navigate to the SharePoint List/Library 2.Open the NewForm or the Edit Form 3.Append the following querystring to the url ?PageView=Shared&ToolPaneView=2 e.g. http://{yoursite}/Lists/listname/NewForm.aspx?PageView=Shared&ToolPaneView=2 http://{yoursite}/Lists/listname/EditForm.aspx?PageView=Shared&ToolPaneView=2 More Info http://www.dhirendrayadav.com/2010/08/modify-newformaspx-and-editformaspx-add.html http://www.sharepointkings.com/2008/05/how-to-edit-list-forms-like-newformaspx.html

Javascript PreSaveAction() in SharePoint 2010 Validation

Image
Go to SharePoint List Defalut Edit or Newform.aspx. over there you have to put the HTML Form WebPart. Inside the HTML Form Webpart you need add the following scripts tag and references. Download js files from here  http://sputility.codeplex.com/ <script src="/Registry/JSFiles/prototype.js" type="text/javascript"></script> <script src="/Registry/JSFiles/SPUtility.js" type="text/javascript"></script> <script type="text/javascript"> function PreSaveAction() { var item=SPUtility.GetSPField('Type of Report').GetValue(); // Choice filed Validation if(item=="Informer") {      alert("Please select the Value");      return false; } else { return true; }  } </script>​

SPUtility.js

Image
http://sputility.codeplex.com/ Installation To use the library, you can just upload SPUtility.js and prototype.js into a document library and put a Content Editor Web Part with some JavaScript code on whichever page you want to modify! Detailed instructions are on the  Installation  page. Usage Examples: Set a Text field's value SPUtility.GetSPField('Title').SetValue('Hello world!'); Set a Text field's value and make it read only SPUtility.GetSPField('Title').SetValue('Hello world!').MakeReadOnly(); Make a Choice field read only Before SPUtility.GetSPField('Status').MakeReadOnly(); After Set a People field and/or Make it Read Only SPUtility.GetSPField('Assigned To').SetValue('Menke, Kit'); SPUtility.GetSPField('Assigned To').MakeReadOnly(); Hide a field from view Before SPUtility.GetSPField('% Complete').Hide(); After