Tuesday, November 18, 2008
HOW TO : INFOPATH FORMS DEPLOYMENT, SHAREPOINT WORKFLOW IN VS 2008
MOSS 64 Bit damm. Not Good for Development
Monday, November 17, 2008
The names and the IP addresses of client computers are not logged when you enable auditing for a site collection in Windows SharePoint Services 3.0
• | When you view the audit reports, you do not see any information logged about the names or the IP addresses of client computers that accessed the site collection. |
• | When you view the AuditData table in the content database of the Web application, the values in the MachineIP column and in the MachineName column appear as NULL. |
Reason for that is :
"The values in the MachineIP column and in the MachineName column appear as NULL because of privacy concerns. By design, Windows SharePoint Services 3.0 works in this manner."
Note : I don't know why they giving those feature when it disable.
http://support.microsoft.com/kb/939246
Wednesday, October 29, 2008
How to use SharePoint Workflow UpdateTask
In order to Update Task, follow these steps:
Follow below settings for UpdateTask Activity:
- Correlation Token: Same as of Create Task activity
- Task ID: Same as of Create Task activity
Insert a Code Activity before Update Task activity.
In Code Activity, write below code:
Note : This is for the change task user (Approver)
Monday, October 27, 2008
Adding Navigation to ECB as Feature
There are number of scenarios that you have to link document library item to custom application page with the list id and the item id. There are two option that have for this.
1. Adding Content Query Web Part ( now i cannot remember how to do this)
2. Adding feature as Custom Action to the ECB.
im going to discuss about how to do it using feature.
In here im writing element.xml it is up to you define the feature and the activate it inside the farm.
<customaction id="MyApplication.ECBItemMenu"
registrationtype="List"
registrationid="101"
location="EditControlBlock"
sequence="105"
title="MyApp Page">
<urlaction url="~site/_layouts/CustomApplicationPages/ApplicationPage4.aspx ?ItemId={ItemId}&ListId={ListId}">
</urlaction>
</customaction>
But this ECB menu will appier only to the document library items. If you need this add to list item, you have to extend this using "Item" content type id. This figure show you content type ids for the base content types in the SharePoint. What you have do is change your "registrationtype" and "registrationid".

This will add this ECB menu to your custom list.
<customaction id="MyApplication.ECBItemMenu"
registrationtype="ContentType"
registrationid="0x010"
location="EditControlBlock"
sequence="105"
title="MyApp Page">
<urlaction url="~site/_layouts/CustomApplicationPages/ApplicationPage4.aspx ?ItemId={ItemId}&ListId={ListId}">
</urlaction>
</customaction>
This are the examples of them
We can add ECB menu to the Dislpay, Edit item form also.
Sunday, October 12, 2008
Create Custom Site Definition for SharePoint with Custom MasterPage
(Visual Studio 2008 extensions for Windows SharePoint Services 3.0 (version 1.2)
Then open wsp view of the solution. If wsp view not visible in the project you can open it from View à Other Windows à WSP View (CTRL+W,I)
Then open webtemp.xml (webtempMyCustomDefinition.xml)
Then change it titel as relevent ( this step is not nessasry )
Now you are ready to deploy your solution.
Deploy your solution using Visual Studio.
Chake follwing folders after complte deploymet
“MyCustomDefinition” at
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\
webtempMyCustomDefinition.xml file at
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML
Make sure to IISRESET
Now you are ready to create new web site using new custom site definition.
Change Deployment tab in template selection .
Thursday, October 9, 2008
ASP.NET AJAX 3.5 and AjaxControlToolkit with SharePoint
How to :
1.) Follow the instructions in the following SharePoint Team Blog post:
Integrating ASP.NET AJAX with SharePoint
2.) Add th
e following assembly bindings to your SharePoint web.config. (This will redirect your AJAX 1.1 assemblies to use AJAX 3.5.)
2.) Add the following assembly bindings to your SharePoint web.config. (This will redirect your AJAX 1.1 assemblies to use AJAX 3.5.)
<configuration >
<runtime >
<assemblyBinding >
<dependentAssembly >
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/ >
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/ >
</dependentAssembly >
<dependentAssembly >
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/ >
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/ >
</dependentAssembly >
</assemblyBinding >
</runtime >
</configuration >
Keep this link also in mind http://daniellarson.spaces.live.com/
Happy coding .............
Thursday, June 5, 2008
SPItemEventReceiver.ItemUpdating + Redirecting to Custom Page
class CustomEventHandler: SPItemEventReceiver {
private HttpContext currentContext = null;
public CustomEventHandler()
: base()
{
if (null != HttpContext.Current)
{
currentContext = HttpContext.Current;
}
}
public override void ItemUpdating(SPItemEventProperties properties)
{
SPSite siteColl = new SPSite(properties.SiteId);
SPWeb site = siteColl.OpenWeb(properties.RelativeWebUrl);
SPList list = site.Lists[properties.ListId];
// Add the item and fill it with the values from properties
DisableEventFiring();
SPListItem itemToUpdate = properties.ListItem;
this.CloneItem(itemToUpdate, properties);
itemToUpdate.update();
EnableEventFiring();
SPUtility.Redirect(site.Url + "/ThankYou.aspx",
SPRedirectFlags.Default, currentContext);
site.Dispose();
siteColl.Dispose();
}
}
}
Note : You can only redirect inside the ItemAdding, ItemUpdating,ItemDeleting events only. Becuae in ItemAdded , ItemDeleted and ItemUpdated context is null.
Tuesday, May 27, 2008
Creating SPField Read Only + Only Date format
SPFieldDateTime spDateField = (SPFieldDateTime)sourceList.Fields.CreateNewField(SPFieldType.DateTime.ToString(), "To");
spDateField.DisplayFormat = SPDateTimeFieldFormatType.DateOnly;
spDateField.ShowInViewForms = true;
// spDateField.DefaultValue = "[today]"; // This assigns Default value today to datetime
spDateField.ReadOnlyField = true;
sourceList.Fields.Add(spDateField);
sourceList.Update();
Creating and Deleting Hidden Fields in SPList
id = sourceList.Fields.Add("SourceRefId", SPFieldType.Guid, false);
SPField field = sourceList.Fields[id];
field.Hidden = true;
field.ReadOnlyField = true;
field.Update();
sourceList.Update();
Deleting
SPField field = sourceList.Fields["SourceRefId"];
field.Hidden = false;
field.ReadOnlyField = false;
field.Update();
sourceList.Fields.Delete("SourceRefId");