1. open your Central Administraion
2. open your SharedServices Provider
3. within the Search Settings go to Content Sources and Crawl Schedule
4. edit the "Local Offices SharePoint Server Sites"
5. within "Start Addresses" enter the following URL to activate and index "People Search"
sps3://YourSiteUrl/
6. After entering the "sps3://YourSiteUrl" start a full crawl and enjoy the people search!
Friday, June 27, 2008
Wednesday, June 25, 2008
To delete a Shared Service in Sharepoint
1) Open cmd prompt
2) Change to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>"
3)run the command, "stsadm -o deletessp -title SharedServices1 -force"
2) Change to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>"
3)run the command, "stsadm -o deletessp -title SharedServices1 -force"
Wednesday, June 18, 2008
Formula to display Month Name from the Date in calculated column in sharepoint
=IF(MONTH([Confidentiality Period])=1,"January","")&IF(MONTH([Confidentiality Period])=2,"February","")&IF(MONTH([Confidentiality Period])=3,"March","")&IF(MONTH([Confidentiality Period])=4,"April","")&IF(MONTH([Confidentiality Period])=5,"May","")&IF(MONTH([Confidentiality Period])=6,"June","")&IF(MONTH([Confidentiality Period])=7,"July","")&IF(MONTH([Confidentiality Period])=8,"August","")&IF(MONTH([Confidentiality Period])=9,"September","")&IF(MONTH([Confidentiality Period])=10,"October","")&IF(MONTH([Confidentiality Period])=11,"November","")&IF(MONTH([Confidentiality Period])=12,"December",""))
In the above formula [Confidentiality Period] is a column of data type "Date and Time".
In the above formula [Confidentiality Period] is a column of data type "Date and Time".
Error: "Calculated columns cannot contain volatile functions like Today and Me. "
When you try to create a calculated column in sharepoint and use [Today] or [Me] in the formula, it will throw an error message, "Calculated columns cannot contain volatile functions like Today and Me."
You can solve the above issue by following the below steps:
1) Create a dummy column with name "Today". Data type can be anything.
2) Create a new calculated column with name whatever u want(for ex.,"TodaysDate").In the formula select the column "Today".(i.e. Formula should be "=[Today]").
3) Specify the data type of the above column as "Date and Time".
4) Go to the column you created first(i.e. Today)in the list settings and click on it. Click on the button "Delete".
5) Add the calculated column you created("TodaysDate") to the view and you can see the current date displayed there.
You can solve the above issue by following the below steps:
1) Create a dummy column with name "Today". Data type can be anything.
2) Create a new calculated column with name whatever u want(for ex.,"TodaysDate").In the formula select the column "Today".(i.e. Formula should be "=[Today]").
3) Specify the data type of the above column as "Date and Time".
4) Go to the column you created first(i.e. Today)in the list settings and click on it. Click on the button "Delete".
5) Add the calculated column you created("TodaysDate") to the view and you can see the current date displayed there.
To convert Text column to Date column format in Sharepoint column
Suppose you have a column(named,"DateText") with text format and the value it returning is of type datetime("2009-06-18T00:00:00"),
To convert it into datetime format(mm/dd/yyyy),
first create a calculated column named Expiration Date, with datatype as datetime and with the follwing formula:
=IF(ISNUMBER(FIND("T",[DateText])),TEXT(LEFT([DateText],FIND("T",[DateText])-1),"mm/dd/yyyy"),TEXT([DateText],"mm/dd/yyyy"))
Then create one more calculated column with DateTime data type and use the following formula:
=DATE(YEAR([Expiration Date]),MONTH([Expiration Date]),DAY([Expiration Date]))
To convert it into datetime format(mm/dd/yyyy),
first create a calculated column named Expiration Date, with datatype as datetime and with the follwing formula:
=IF(ISNUMBER(FIND("T",[DateText])),TEXT(LEFT([DateText],FIND("T",[DateText])-1),"mm/dd/yyyy"),TEXT([DateText],"mm/dd/yyyy"))
Then create one more calculated column with DateTime data type and use the following formula:
=DATE(YEAR([Expiration Date]),MONTH([Expiration Date]),DAY([Expiration Date]))
Monday, June 16, 2008
Get current user roles in Sharepoint
string UserRoles = string.Empty;
SPSite SiteName = new SPSite(SITE_URL);
SPWeb web = SiteName.OpenWeb();
foreach (SPRole role in web.CurrentUser.Roles)
{
UserRoles += role.Name + ";";
}
SPSite SiteName = new SPSite(SITE_URL);
SPWeb web = SiteName.OpenWeb();
foreach (SPRole role in web.CurrentUser.Roles)
{
UserRoles += role.Name + ";";
}
Send an email with Attachment in C#.Net
Here is the method to send an attachment with mail.
using System.Web.Mail;
public string SendAttachmentEmail(string MailTo, string MailSubject, string MailBody, string AttachPDFPath, string MailFrom, string MailServer)
{
# region Email
try
{
try
{
MailMessage Message = new MailMessage();
Message.To = MailTo;
Message.From = MailFrom;
Message.Subject = MailSubject;
Message.Body = MailBody;
try
{
Message.Attachments.Add(new MailAttachment(AttachPDFPath));
}
catch (Exception ex)
{
return "Error while accessing attachemnt" + ex.ToString();
}
Message.BodyFormat = MailFormat.Html; //Specify mail format either text or html
try
{
SmtpMail.SmtpServer = MailServer; //Specify the exchange server name
SmtpMail.Send(Message);
return "true";
}
catch (System.Web.HttpException ehttp)
{
return ehttp.ToString();
}
}
catch (IndexOutOfRangeException ex)
{
return ex.ToString();
}
}
catch (System.Exception e)
{
return e.ToString();
}
# endregion
}
using System.Web.Mail;
public string SendAttachmentEmail(string MailTo, string MailSubject, string MailBody, string AttachPDFPath, string MailFrom, string MailServer)
{
# region Email
try
{
try
{
MailMessage Message = new MailMessage();
Message.To = MailTo;
Message.From = MailFrom;
Message.Subject = MailSubject;
Message.Body = MailBody;
try
{
Message.Attachments.Add(new MailAttachment(AttachPDFPath));
}
catch (Exception ex)
{
return "Error while accessing attachemnt" + ex.ToString();
}
Message.BodyFormat = MailFormat.Html; //Specify mail format either text or html
try
{
SmtpMail.SmtpServer = MailServer; //Specify the exchange server name
SmtpMail.Send(Message);
return "true";
}
catch (System.Web.HttpException ehttp)
{
return ehttp.ToString();
}
}
catch (IndexOutOfRangeException ex)
{
return ex.ToString();
}
}
catch (System.Exception e)
{
return e.ToString();
}
# endregion
}
Subscribe to:
Posts (Atom)