Saturday, May 18, 2013

Deploying workflows from one server to another server in SharePoint 2010


Below are the STEPS to fallow to deploying workflows in SharePoint 2010 from one server to another.
Ex: Development server to QA or Production Server.

STEPS:
 

1)      Open Development site in designer and open TESTWORKFLOW workflow
2)      From Ribbon select Export to Visio option which allows you to save the workflow with a .vwi extension.  (Save as Name: SourceWorkflowName.vwi)
3)      Now go to the Production/QA site where you want the workflow to be copied, and create a new workflow with the same name TESTWORKFLOW & publish it. (Note: don’t add any step. Just publish blank workflow)
4)      Now select Export to Visio option which allows you to save the workflow with a .vwi extension.  (Save as Name: DestinationWorkflowName.vwi)
5)      Now you will be having two .vwi files (one of source workflows – SourceWorkflowName.vwi and other of the destination workflows – DestinationWorkflowName.vwi). Now add .zip extension to both the files. Now your files names should be SourceWorkflowName.vwi.zip & DestinationWorkflowName.vwi.zip.
6)      Now open both the zip files, copy workflow.xoml.wfconfig.xml from destination workflow to source workflow. (Its destination to source and not source to destination).
7)      From now on, we will not use the file DestinationWorkflowName.vwi.zip.  So ignore that file.
8)      Remove the .zip extension from SourceWorkflowName.vwi.zip which gives you the   SourceWorkflowName.vwi file.
9)      Now, go to the production site, open workflows and click Import from Visio and browse to the SourceWorkflowName.vwi file.
10)  That’s it and your workflow is copied. You can publish the workflow.

Thursday, March 28, 2013

Open Sharepoint document Library PDF files in New window

STEP1:


Edit the view page by selecting Site Actions  Edit Page.


STEP 2:

Click on “Add Web Part” and then select the Content Editor Web part from “Media and Content” category.










STEP 3:

Click on Content Editor web part

And then from ribbon select the Format Text HTMLEdit HTML Source





STEP 4:

Copy and paste the below given JavaScript code in HTML Source and click on OK.

------------------------------------------------- CODE -------------------------------------------------------

<script language="javascript" type="text/javascript">



_spBodyOnLoadFunctionNames.push("OpenPDFInNewWindow()");



function OpenPDFInNewWindow()

{

var aAllLinks = document.links;

for(var i=0;i<aAllLinks.length;i++)

{

var oA = aAllLinks[i];

var sHREF = oA.href.toLowerCase();



if(sHREF.indexOf(".jpg") > 0

sHREF.indexOf(".pdf") > 0)

{

oA.onclick=function()

{

var w=window.open(this.href,'_blank','');

if(w) {

w.focus();

return false

};

return true;

}

}

}

} </script>



------------------------------------------------- CODE END-------------------------------------------------------







STEP 5:

Edit the Content Editor web part and set the options as below:


Referred  URLs, please check below URLs for more details:

Thursday, March 21, 2013

Don't Show Missing Image Icon Suppose you have html page that will display users profile with profile images and if image is not present, automatically missing image icon is appearing, it's looks unprofessional. We can hide this icon or replace with the default image. Simply Hide the missing image icon using Javascript:

Thursday, May 24, 2012

Identify Worker Process ID in w3wp.exe IIS 6.0 and IIS 7.0

To know more about IIS Request Process, here is one of my aticle How IIS Process ASP.NET Request



Identify Worker Process in IIS 6.0

• Start > Run > Cmd

• Go To Windows > System32


• Run cscript iisapp.vbs

• You will get the list of Running Worker ProcessID and the Application Pool Name.






So, here is your list of all worker process with corresponding application pool name. From the Application pool name you can easily identify which worker process is related with your application.

Identify Worker Process in IIS 7.0





From IIS 7.0 you need you to run IIS Command Tool ( appcmd ) .


• Start > Run > Cmd


• Go To Windows > System32 > Inetsrv


• Run appcmd list wp






This will show you list worker process that is running on IIS 7.0 in the similar format of IIS 6.0








The 's Technical blog has explain this more clearly, please check here for more details:







Friday, November 4, 2011

adjust the NewForm/EditForm fields width through the JavaScript in SharePoint

Modify the NewForm/EditForm fields width through the JavaScript as below:

script type="text/javascript" language="javascript"

//width
var inputs = document.getElementsByTagName("input"); //this is for textboxes
var textareas = document.getElementsByTagName("textarea"); //this is for multipline textbox
var selects = document.getElementsByTagName("select"); //this is for dropdown and date fileds

var width = 225;

for(var i=0;i{
if(inputs[i].className == "ms-long")
{

inputs[i].style.width = width + "px";
}

}

for(var i=0;i{
if(textareas[i].className == "ms-long")
{
textareas[i].style.width = width + "px";
}

}

for(var i=0;i{
if(selects[i].className == "ms-RadioText")

{
selects[i].style.width = width + "px";

}

}


/script

Reference URL: http://blogs.msdn.com/b/sharepointdesigner/archive/2008/01/25/modify-the-lengths-of-list-form-fields.aspx

Modify the lengths of list form fields through the javascript in Sharepoint

modify the NewForm/EditForm fileds width through the javascript as below:

<---script type="text/javascript" language="javascript">
//width
var inputs = document.getElementsByTagName("input"); //this for textboxes
var textareas = document.getElementsByTagName("textarea"); //this for multiline textboxes

var selects = document.getElementsByTagName("select"); //this for dropdown and date fileds
var width = 225;// need to set the wi

for(var i=0;i{
if(inputs[i].className == "ms-long" && (inputs[i].title=="custcity" || inputs[i].title=="cust_st" || inputs[i].title=="custzip") )
{
inputs[i].style.width = "75px";
}
else
{
inputs[i].style.width = width + "px";
}

}

for(var i=0;i{
if(textareas[i].className == "ms-long" && textareas[i].title=="stat_history")
{
textareas[i].style.width = width +200 + "px";
}
else
{
textareas[i].style.width = width + "px";
}

}

for(var i=0;i{
if(selects[i].className == "ms-RadioText")

{
selects[i].style.width = width + "px";

}

}
<--/script>

Thursday, July 8, 2010

DateTime’s String Formats in C#.net.

DateTime’s String Formats in C#.net.
Hi Friends, This artical shows how to work with the DateTime formats using Sting.Format method.
NOTES:
y :- indicates “year”.
M :- indicates “month”
d :- indicates “day”
h :- hour (12 format)
H :- hour (24 format)
m :- minute
s :- second
Following examples helps you to customize the DateTime format.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DateTimeFormats
{
class Program
{
static void Main(string[] args)
{


//DateTime.DateTime _dt = DateTime.Today.ToLongTimeString();
//suppose today is 08/20/1979 20th august 2010.

Console.Write("Todays Date: ");
Console.WriteLine(DateTime.Today.ToUniversalTime());


Console.Write("year format '10 10 010 2010 (y yy yyy yyyy) ' : ");
Console.WriteLine(String.Format("{0:y yy yyy yyyy}", DateTime.Today));

Console.Write("month format '7 07 Jun June (M MM MMM MMMM) ' : ");
Console.WriteLine(String.Format("{0:M MM MMM MMMM}", DateTime.Today));

Console.Write("day format '29 29 Tue Tuesday (d dd ddd dddd) ' : ");
Console.WriteLine(String.Format("{0:d dd ddd dddd}", DateTime.Today));


Console.Write("hour format(12/24) '4 04 16 16 h hh H HH ' : ");
Console.WriteLine(String.Format("{0:h hh H HH}", DateTime.Today.ToUniversalTime()));

Console.Write("minute format '5 05 m mm' : ");
Console.WriteLine(String.Format("{0:m mm}", DateTime.Today.ToUniversalTime()));

Console.Write("second format '5 05 s ss' : ");
Console.WriteLine(String.Format("{0:s ss}", DateTime.Today.ToUniversalTime()));


Console.Write("second format 'd/M/yyyy HH:mm:ss' : ");
Console.WriteLine(String.Format("{0:d/M/yyyy HH:mm:ss}", DateTime.Today.ToUniversalTime()));




Console.ReadLine();
}
}
}

OUTPUT is:








As well as if you want to work with Standard DateTime Formatting
Following table shows patterns defined in DateTimeForma¬tInfo and their values for en-US culture. First column contains format specifiers for the String.Format method.
Specifier DateTimeFormatInfo property Pattern value (for en-US culture)
t ShortTimePattern h:mm tt
d ShortDatePattern M/d/yyyy
T LongTimePattern h:mm:ss tt
D LongDatePattern dddd, MMMM dd, yyyy
f (combination of D and t) dddd, MMMM dd, yyyy h:mm tt
F FullDateTimePattern dddd, MMMM dd, yyyy h:mm:ss tt
g (combination of d and t) M/d/yyyy h:mm tt
G (combination of d and T) M/d/yyyy h:mm:ss tt
m, M MonthDayPattern MMMM dd
y, Y YearMonthPattern MMMM, yyyy
r, R RFC1123Pattern ddd, dd MMM yyyy HH':'mm':'ss 'GMT' (*)
s SortableDateTi¬mePattern yyyy'-'MM'-'dd'T'HH':'mm':'ss (*)
u UniversalSorta¬bleDateTimePat¬tern yyyy'-'MM'-'dd HH':'mm':'ss'Z' (*)
(*) = culture independent