March 21, 2012

"No content databases are available for restoring this site collection. Create a new content database and then try the restore operation again

This is because the globally-unique identifiers (GUID) for lists are preserved in the backup file and reused during restore, but the content database requires list GUIDs to be unique. Therefore, you cannot restore a site collection twice to the same content database, and must instead use a different content database. 

Custom Upload Form - SharePoint 2010 (Not Sandbox)

http://byteloom.blogspot.com/2012/01/custom-upload-form-for-document-library.html

http://blogs.msdn.com/b/syedi/archive/2008/07/18/custom-upload-page-in-layouts-for-document-library-and-it-s-navigation-from-upload-menu-in-the-toolbar-bend-it-custom-upload-menu-for-the-document-library.aspx

Query Strings in SharePoint 2010 - Custom Forms - SPServices

http://geekswithblogs.net/SoYouKnow/archive/2009/10/29/setting-sharepoint-form-fields-using-query-string-variables-without-using.aspx

(xizwyck)
http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/872dccfb-7b89-4076-8983-05359349cdfe/

http://splittingshares.wordpress.com/2008/04/22/defaulting-a-hidden-field-on-a-form/

LookUp Query String


<script type="text/javascript">
$(document).ready(function(){
var queryStringVals = $().SPServices.SPGetQueryString();
var IDtoGet = queryStringVals["theCID"];
var insEmail = queryStringVals["InstructorEmail"];
  $("textarea[Title$='People Picker']").val(insEmail);
  $("div[title='People Picker']").text(insEmail); }); //close doc ready
</script>

http://sharepoint.stackexchange.com/questions/17243/apply-metadata-based-on-query-string-or-selected-value-in-page-control

http://sharepoint.stackexchange.com/questions/29613/how-can-i-pass-a-parameter-via-query-string-to-populate-a-lookup-field-on-a-new

Resources: SPServices
http://spservices.codeplex.com/wikipage?title=%24%28%29.SPServices.SPGetQueryString&referringTitle=Documentation

Object Model

 string qryParameter = Page.Request.QueryString["k"].ToString();
  HttpContext.Current.Response.Redirect("Page.aspx?k=" + qryParameter);



SP2010 OOB Feature Id's

March 20, 2012

Modal Pop Up Close Window.Close() - Display

javascript: window.open('', '_self', '');window.close();


For Modal Pop Up Close in SharePoint


<input type="button" onclick="javascript:window.frameElement.commitPopup();" value="No" />


Displays a modal dialog : 


//Using the DialogOptions class.
var options = SP.UI.$create_DialogOptions();

options.title = "My Dialog Title";
options.width = 400;
options.height = 600;
options.url = "/_layouts/DialogPage.aspx";

SP.UI.ModalDialog.showModalDialog(options);

//Using a generic object.
var options = {
    title: "My Dialog Title",
    width: 400,
    height: 600,
    url: "/_layouts/DialogPage.aspx" };

SP.UI.ModalDialog.showModalDialog(options);

http://msdn.microsoft.com/en-us/library/ff410058.aspx 


Normal Window Modal Dialog

http://msdn.microsoft.com/en-us/library/ie/ms536759(v=vs.85).aspx 

OfficeWebApp Feature - Could not find Feature MobilePowerPointViewer, ExcelServerEdit - Installation

SharePoint 2010 import the .cmp

March 15, 2012

ddwrt Functions in CQWP - DateTime - UserLookUp

http://www.uccorner.com/231/sharepoint/content-query-web-part-image-on-left-with-formatted-date-and-description/

<xsl:value-of select="ddwrt:FormatDateTime(string(normalize-space(@DateField)) ,1033 ,'dd/MM/yyyy')" />


xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"

ddwrt:UserLookup(string($variable),'ID')




XSLT White Space


<xsl:text>   </xsl:text>

or Use nonbreaking space in between text tags & # x A 0 ;

March 14, 2012

CQWP - ItemStyle - SiteUserInfoList - Client Object Model - ECMAScript

http://www.glynblogs.com/2010/11/viewing-raw-data-in-a-content-query-web-part.html

http://www.glynblogs.com/2010/11/display-a-users-picture-in-the-content-query-web-part.html

Debugging:
http://www.heathersolomon.com/blog/articles/customitemstyle.aspx

http://kyleschaeffer.com/sharepoint/sharepoint-2010-item-styles-and-ddwrt/

Other Resources

http://www.turhaltemizer.com/2010/10/sharepoint-2010-client-object-models.html

For Fields to Display, have this in Item Style.
Note: Give normal name with spaces there and in XSLT use _x005F_x0020_ for spaces.


<xsl:variable name="SafeLinkUrl">
       <xsl:call-template name="OuterTemplate.GetSafeLink">
            <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
       </xsl:call-template>
  </xsl:variable>
  <xsl:variable name="DisplayTitle">
       <xsl:call-template name="OuterTemplate.GetTitle">
           <xsl:with-param name="Title" select="@Title"/>
           <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
           <xsl:with-param name="UseFileName" select="1"/>
       </xsl:call-template>
  </xsl:variable>





March 10, 2012

Visual Studio 2010 Uninstall Fails - Setup Failed - Silverlight Instal

1. Check Administative Tools --> Services --> Windows Module Installer --> Start
2. First Check the Installed Updates for VS 2010
3. Uninstall all related updates (HotFix, Security Update)
4. Now, From UnInstall Programs --> UnInstall VS 2010

For Silverlight

1. Install VS 2010
2. Install VS 2010 SP1
3. Remove Silverlight Related from Add or Remove Programs
4. Try Creating a SilverLight Application from VS2010.
5. It will complain of Silverlight with a download link
6. Close VS 2010 and Install Silverlight from download link and Have Fun

..... That's my 12 hours trial and error notes with VS 2010 UnInstall Issues.

Invoke or BeginInvoke cannot be called on a control until the window handle has been created.

SharePoint 2010 on Windows 7

March 08, 2012

SharePoint List Joins

People Picker - Application Pages

Add a ‘Create New Document’ link to a page

The type or namespace name 'Query' does not exist in the namespace 'Microsoft.Office.Server.Search' (are you missing an assembly reference?)

Remove the Microsoft.Office.Server and Microsoft.Office.Server.Search dll refrences and add back in.

Microsoft.Practices

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=15104

Download.

Run GAC_ServiceLocation.

Build Microsoft.SharePoint.Practices.Common Solution.

Change Feature Folder Name in VS 2010


http://www.ride-the-bytes.com/?p=1116

http://www.townofbedrock.com/blog/?p=219

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters -- Usually if we have a big feature folder name.


Double-Click on Feature and then Hit F4 to change the feature folder deployment name.



By default the value for Deployment Path is:
$SharePoint.Project.FileNameWithoutExtension$_$SharePoint.Feature.FileNameWithoutExtension$
Change the Deployment Path value to:
$SharePoint.Feature.FileNameWithoutExtension$



March 07, 2012

Site Columns Delete - Prerequisites

1. Site columns which are included in content types cannot be deleted. Remove all references to this site column prior to deleting it 

2. The Site column will be removed and all list columns which were created from it will be permanently orphaned. Are you sure you want to delete this column.

From Drop Off Library

1. This Column will be removed and all the data stored in the column will be permanently deleted. If this column is currently being used by any content types, it will be removed from those types. Are you sure you want to delete this column?
Notes: It is talking for only that library

Custom Edit Form - Document Library (Make Sure you have one entry before you start)

1. To create a custom edit form where you can edit the editform page and create the controls.

2. Just go to the particular list you wish to customize in Sharepoint Designer, copy the original editform.aspx and open up the editform.aspx copy. In there delete the listform webpart and go to insert -> Sharepoint List Controls -> Custom list form.

2. Edit/Customize

3. Save

Note: If you open editform with no items in document library, you will just see Save and Cancel Button.
So, Make sure you have atleast one item and then try to see the changes in the browser.

Blocked by port blocking rule (Anti-virus Standard Protection:Prevent IRC communication).

McAfee doesnot like the port number, change the port number :)

March 02, 2012

Could not save the list changes to the server - Sharepoint Designer 2010

Or when you create a new form, but you just see Save and Cancel Button and nothing else.

Resolution: Empty the Recylce Bin

File Upload Control Explained

http://msdn.microsoft.com/en-us/library/ms454491.aspx

http://www.codeproject.com/Articles/20023/ASP-NET-2-0-FileUpload-Server-Control


if (FileUpload1.HasFile)
            {
                Hashtable reqProperties = new Hashtable();
                reqProperties.Add("vti_title", "Test");
                String fileToUpload = FileUpload1.PostedFile.FileName;
                String documentLibraryName = "Submissions";
                Stream fStream = FileUpload1.PostedFile.InputStream;
                byte[] contents = new byte[fStream.Length];
                SPFolder myLibrary = SPContext.Current.Web.Folders[documentLibraryName];
                SPFile spfile = myLibrary.Files.Add(FileUpload1.FileName, contents, reqProperties, true);
            }

Central Admin rendering without CSS and scripts

SonarQube with Jenkins Setup using Docker Images

https://funnelgarden.com/sonarqube-jenkins-docker/  https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...