Hi,
After struggling a lot with MOSS document library event handlers I found some solution on it.
Scenario: - I need to update file name property using event handler but not from standard view of document library but from the datasheet view of it. Always getting the resolve link with some error on the view.
Solution: Finally I got the solution for this known issue (MS) in MOSS. Below is some sample code for the same.
public override void ItemUpdated(SPItemEventProperties properties)
{
try
{
this.DisableEventFiring();
string fileName = properties.AfterUrl;
fileName = fileName.Split('/')[1].ToString();
SPList list;
SPListItem item;
list = properties.ListItem.ParentList;
item = list.GetItemById(properties.ListItemId);
if (!Convert.ToString(item["Filename"]).Equals(fileName))
{
item["Filename"] = fileName;
item.SystemUpdate(false);
}
this.EnableEventFiring();
}
catch (Exception ex)
{
}
finally
{
this.EnableEventFiring();
}
base.ItemUpdated(properties);
}
Hope it will help a lot of guys we need it badly like me.
Friday, January 7, 2011
Tuesday, August 25, 2009
How to configure Alternate Access Mapping to your site.
Hi,
Whenever user working with MOSS or WSS on extranet or internet* environment. User always need to set the URL according to company's standard by not showing IP or server name in URL of you site. As by default MOSS/ WSS site showing on user's server name in URL.
So by setting the Alternate Access Mapping of with your live IP you can easily achieve your goal.
Here are the easy steps to do this:-
1. On the top navigation bar, click Operations.
2. On the Operations page, in the Global Configuration section, click Alternate access mappings.
3. On the Alternate Access Mappings page, click Add Internal URLs.
4. If the mapping collection that you want to modify is not specified, then choose one. In the Alternate Access Mapping Collection section, click Change alternate access mapping collection on the Alternate Access Mapping Collection menu.
5. On the Select an Alternate Access Mapping Collection page, click a mapping collection.
6. In the Add internal URL section, in the URL protocol, host and port box, type the new internal URL (for example, https://www.microsoft.com/) .
7. In the Zone list, click the zone for the internal URL.
8. Click Save.
For more information please refer :- http://technet.microsoft.com/en-us/library/cc263208.aspx
*For MOSS internet facing sites you need to perchase different licence from Microsoft.
Kuldee Kadyan
Whenever user working with MOSS or WSS on extranet or internet* environment. User always need to set the URL according to company's standard by not showing IP or server name in URL of you site. As by default MOSS/ WSS site showing on user's server name in URL.
So by setting the Alternate Access Mapping of with your live IP you can easily achieve your goal.
Here are the easy steps to do this:-
1. On the top navigation bar, click Operations.
2. On the Operations page, in the Global Configuration section, click Alternate access mappings.
3. On the Alternate Access Mappings page, click Add Internal URLs.
4. If the mapping collection that you want to modify is not specified, then choose one. In the Alternate Access Mapping Collection section, click Change alternate access mapping collection on the Alternate Access Mapping Collection menu.
5. On the Select an Alternate Access Mapping Collection page, click a mapping collection.
6. In the Add internal URL section, in the URL protocol, host and port box, type the new internal URL (for example, https://www.microsoft.com/) .
7. In the Zone list, click the zone for the internal URL.
8. Click Save.
For more information please refer :- http://technet.microsoft.com/en-us/library/cc263208.aspx
*For MOSS internet facing sites you need to perchase different licence from Microsoft.
Kuldee Kadyan
Thursday, August 6, 2009
Open a page in edit mode directly in Sharepoint
Hi,
Because of some web part problem or browser issues user is not able to open page in edit mode. Then what should he do??? Don't worry i will suggest you something may be it will work for u also as worked for me.
Just type ListURL?ToolPaneView=2 in your browser and get the things works for you.
Enjoy!!!
Kuldeep Kadyan
Because of some web part problem or browser issues user is not able to open page in edit mode. Then what should he do??? Don't worry i will suggest you something may be it will work for u also as worked for me.
Just type ListURL?ToolPaneView=2 in your browser and get the things works for you.
Enjoy!!!
Kuldeep Kadyan
Add Link on List Column Value Using DataView WebPart
Add HyperLink on any column value in a Form using Dataview webpart is now its very easy.
Use this trick for your solution:-
<script language="javascript">
var a ="<xsl:value-of select="@FileName" />"
document.write('<a href=/HelpDocuments/' + a + '> download </a> ');
</script>
*change curly brackets with respective angular brackets.
Hope its works for you also!!!
Use this trick for your solution:-
<script language="javascript">
var a ="<xsl:value-of select="@FileName" />"
document.write('<a href=/HelpDocuments/' + a + '> download </a> ');
</script>
*change curly brackets with respective angular brackets.
Hope its works for you also!!!
Tuesday, July 14, 2009
How to delete Bad lists from SharePoint
Hi,
I was doing development in my last project (WSS3.0). I was doing some R&D on a SharePoint list. That list goes corrupted and not even i was able to open that.
So i decide to delete from my sharepoint site. What is this!!! how can i delete this list because delete option is coming under the list settings. What i have to do now???
Then i got a brilliant idea in my mind why not i use STSADM for this.
Here is that superb command which can help everybody who is hanged up with this problem:-
stsadm -o forcedeletelist -url http://localhost/Lists/Badlist
Enjoy!!!
Kuldeep Kadyan
I was doing development in my last project (WSS3.0). I was doing some R&D on a SharePoint list. That list goes corrupted and not even i was able to open that.
So i decide to delete from my sharepoint site. What is this!!! how can i delete this list because delete option is coming under the list settings. What i have to do now???
Then i got a brilliant idea in my mind why not i use STSADM for this.
Here is that superb command which can help everybody who is hanged up with this problem:-
stsadm -o forcedeletelist -url http://localhost/Lists/Badlist
Enjoy!!!
Kuldeep Kadyan
How to get Display Name of List Column in SharePoint
Hi,
Few days back i was struggling a lot about to get the Display Name of list columns because client was not ready to move a single bit on his decision to show only column's display name not the internal name.
I spent near about the whole day to find out the solution of this problem. Thank god finally i got the lines of code that helped me.
I do not want to anybody else will struggle for the same.
I am putting code here:-
Get Display name of list columns
foreach(DataColumn column in table.Columns)
{
column.ColumnName = list.Fields.GetFieldByInternalName(column.ColumnName).Title;
}
It can save your time for sure.
Kuldeep Kadyan.
Few days back i was struggling a lot about to get the Display Name of list columns because client was not ready to move a single bit on his decision to show only column's display name not the internal name.
I spent near about the whole day to find out the solution of this problem. Thank god finally i got the lines of code that helped me.
I do not want to anybody else will struggle for the same.
I am putting code here:-
Get Display name of list columns
foreach(DataColumn column in table.Columns)
{
column.ColumnName = list.Fields.GetFieldByInternalName(column.ColumnName).Title;
}
It can save your time for sure.
Kuldeep Kadyan.
How to get Sum of any column in DataView Web Part in SharePoint
Hi,
Another basic requirement of client if you are using the DVWP in your project. Show the total of any column. I spent 3-4 hours to get it down but finally i found that.
Find sum of any column in DVWP
{xsl:value-of select="sum(/dsQueryResponse/Rows/Row/@fld_EmployeeSalary)" /}
Replace curly brackets with angular brackets
You had done that here.
Enjoy!!!
Kuldeep Kadyan
Another basic requirement of client if you are using the DVWP in your project. Show the total of any column. I spent 3-4 hours to get it down but finally i found that.
Find sum of any column in DVWP
{xsl:value-of select="sum(/dsQueryResponse/Rows/Row/@fld_EmployeeSalary)" /}
Replace curly brackets with angular brackets
You had done that here.
Enjoy!!!
Kuldeep Kadyan
Subscribe to:
Posts (Atom)
