tag:blogger.com,1999:blog-7094186787490094460.post5816079483017762704..comments2023-07-30T07:39:39.973-07:00Comments on Iguana Gears: MOSS/SharePoint ItemUpdated() & ItemUpdating Events Not Picking Up Content Type MetadataGarthhttp://www.blogger.com/profile/13310866208150603783noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7094186787490094460.post-50185438451602514442009-06-29T04:27:14.410-07:002009-06-29T04:27:14.410-07:00I'm sure by now you found the answer to your q...I'm sure by now you found the answer to your question, Biju:<br /><br />http://blogs.msdn.com/varun_malhotra/archive/2009/05/25/modify-a-date-time-value-field-in-event-handlers-through-afterproperties.aspx<br /><br />That was a great bit of pain for me over the course of a day.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7094186787490094460.post-68532546932786079272009-05-20T02:54:45.171-07:002009-05-20T02:54:45.171-07:00Hi,
I'm overriding the ItemUpdatin...Hi,<br /><br /> <br /><br /> I'm overriding the ItemUpdating event; here I have a field "Start Date”. Now when a user edits the Start date of an item and clicks "OK", I need to capture the previous and latest start date and compare them.<br /><br /> <br /><br />I'm able to getthe previous date by the following code<br /><br /> <br /><br /><I> SPWeb contextWeb = properties.OpenWeb();<br /><br /> SPList spList = contextWeb.Lists[properties.ListId];<br /><br /> SPListItem contextItem = spList.GetItemById(properties.ListItemId);<br /><br /> <br /><br /> <br /><br /> current_id = Convert.ToInt32(contextItem["ID"]);<br /><br /> <br /><br /> if (contextItem["Start Date"] != null)<br /><br /> current_StartDate = (DateTime)contextItem["Start Date"];<br /><br /> <br /><br /></I> <br /><br />But am not able to get the latest(committed) Start date.<br /><br /> <br /><br />I tried using the AfterProperty, but no luck :(<br /><br /> <br /><br /> <br /><br /><I>if (properties.AfterProperties["Start Date"] != null)<br /><br /> updated_StartDate = Convert.ToDateTime(properties.AfterProperties["Start Date"].ToString());<br /><br /> <br /><br /></I> <br /><br /> <br /><br />Can you help me in finding the solution for the same<br /><br /> <br /><br /> <br /><br />PS: I have posted my query on Microsoft’s site also http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/fc56a0f9-9688-479f-b984-5ee3809e72cb/#7259f555-3803-4220-9357-beb4397452d8B1juhttps://www.blogger.com/profile/01031168874321238009noreply@blogger.comtag:blogger.com,1999:blog-7094186787490094460.post-39406609828303043682008-12-04T01:44:00.000-08:002008-12-04T01:44:00.000-08:00VadimK, I'm not sure exactly what you are trying t...VadimK, <BR/>I'm not sure exactly what you are trying to do here. At what point do you want to intercept the page on the "Edit Form" of a list item?<BR/>Editing the Existing Edit Forms of SharePoint require you to use SharePoint Designer. You cannot use code in SharePoint designer.<BR/><BR/>With regards to MOSS Pages they are ASP.Net pages. So if you create your own page using Visual Studio and put it in the 12 hive it will behave as a ASP.Net page so you can use Page_Load or the normal ASP.Net page events.Garthhttps://www.blogger.com/profile/13310866208150603783noreply@blogger.comtag:blogger.com,1999:blog-7094186787490094460.post-41483928479778623252008-09-03T07:54:00.000-07:002008-09-03T07:54:00.000-07:00Read your post and thought you might know how to '...Read your post and thought you might know how to 'intercept' moss page event and prevent moss from stripping/adding html in article content i.e. html comments. If you can point me in general direction of the solution to this problem, I would really appriciate it.Unknownhttps://www.blogger.com/profile/13681527652714748429noreply@blogger.com