Why did the SharePoint event receiver stop firing? - sharepoint

I have a SharePoint 2010 solution. I have a List Definition and an event receiver associated with the definition. I have a list instance associated with the definition. The event receiver has a single method, ItemDeleting, that was working for several days up until some point yesterday.
I am working off my dev box, 2008R2, and am deploying directly from VS2010. When I set a breakpoint and delete an item on the list I never hit the break point. I built the package and deployed the solution to a demo box and the event receiver does fire there just not on my dev box any longer. I have dropped the content database and restored and tried a few other things but the event still will not fire.
Where should I look to resolve this issue?

I had a similiar issue happen where a click event never made it to the handler just as if the event had been swallowed. In my case, I finally found that an exception had been thrown which short-circuited the event.
Check for a exception being thrown somewhere.

Check if the DLL that contains the Event Receiver is located in the GAC.It could be a deployment problem.
Have a look at the "manifest.xml".

Related

Sharepoint Concurrency Issue

I am totally new to Sharepoint development (Sharepoint 2013), and could use some help.
I inherited a console application where I'm getting this message below:
Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes.
Actually, within the application and another console application (both running as jobs), there are numerous using blocks where they are newing up SPSite and SPWeb, opening the same list, and looping through the entries and posting update. These loop are incredibly slow. So the SPSite and SPWeb stays open for a long time, while additional SPSite/SPWeb are new'ed up to the same list.
Should I new up only one SPSite and SPWeb per application and use them globally within the application? Should I grab my list objects and assign them to a .NET List and close out the SPSite/SPWeb and then when I'm ready to update the record to temporarily new up a SPSite/SPWeb for the duration of the Update()? These list items are being updated by the other job as well while marching thru the list and posting updates to the same list. Is that an issue?
In reality, the notion of a Error Log list exists as well. Items are constantly being appended to this list. Would that cause that error message above?
Would create a Retry loop for the Update() work? Or is the issue of the list item updated by another process prevent a successful update?
Thanks.

UILocalnotification is not appearing when the application is in the background

I have a monotouch application which has a timer and gets the data from the server.
Once the data is received i want to show the notification on the status bar.
It wrks fine when the app is in foreground. When the app is in background ,neither the timer nor the notification works
Please help me in rectifying this issue.
getting you app to run in the background is easy, add App registers for location updates in the info.plist, create a CLlocation singleton register for significant location change and you are done, your app will be resurrected every time there is a significant location change
When an iOS app transitions to the suspended (i. e. backgrounded) state, it stops its timers and disables locl notifications (and does some more memory optimization-related actions). A possible solution (JB only) to display user alerts while your app is in the background is to run a server (true unix server which is not bothered by an app getting backgrounded!) and use the undocumented CFUserNotificationDisplayAlert() function (just google it).
Your best chance is to extend the lifetime of your app by a little bit, by requesting a grace period in the background. As long as you receive this message during this time frame, you will be able to post the notification.
You do this by calling UIApplication.BeginBackgroundTask. This will let you run for a little bit, and the method you pass will be invoked shortly before your grace period runs out.
When you have an App with registers for location updates it seems to always run in the background to a certain extent, as you get significan location changes and you get the enter/exit regions, so you app is running code or is being waken up to run code... the problem is that the UILocalnotification doesn't trigger a sound and alert consitently ( but all the calls are displayed in the notification center... ) The big problem here is that the significan location changes, and the enter/exit regions are useless if you can not notify your user reliably.... is CFUserNotificationDisplayAlert() the only solution to trigger an alert to the user... ? does it work ? will your app be rejected if you use it ?
I got this working as follows :(Not a good design, but a working one)
Addded location support in info.plist, create a clocation manager and kept on requsting the location services. On the same loop schedule the UIlocalnotification .
It works perfectly. :)
NOTE : One issue is that it will give the user a propmpt as "This app uses your location, Do you want o allow"

SharePoint Expiration Policy does not fire ItemDeleting Event Receiver

We have attached an ItemDeleting event receiver to a list that requires certain maintenance to be performed in other lists whenever an item is deleted. It works fine when an item is manually deleted by a user. However, if an item is deleted as a result of the Information Management Policy we have defined to delete expired items, the ItemDeleting handler is not executing. Is this standard MOSS behavior? If so, are there any suggested workarounds?
I would run a custom workflow using the policy, there you can define your own logic, which is what you probably try to achieve

Why does my Workflow Service (4.0) variable go null in a DoWhile Activity?

I have a WF service that I'm trying to setup receive activities to "Subscribe" and "Unsubscribe". I'm using This WF Durable Duplex Tutorial as a basis because my service performs callbacks to clients. Basically, think of it as a chat service.
I can make client calls to the two receive activities just fine. What happens is the callback address of the client is passed in to Subscribe() on the service. The address is stored as a variable in the WF service and everything looks like it would work as to be expected.
When a client calls Unsubscribe(), my watch I have set on the address var during debugging shows it as null. So what gives?
Here's the basic setup of my WF service layout...
Everything is enveloped in a DoWhile activity. Inside of that is a Pick activity and two Pick branches. The first branch is for subscribing activities. It has a receive-sendreply activity that assigns the string passed by the client to the WF address var. The second branch handles unsubscribing. The trigger is the Request activity and the client address is again passed in.
From there it goes into a sequence, starting with an If. It checks to see if the unsubscribeAddress equals the address already subscribed. If it does, then it sets the address to String.Empty and sends a success message back to the client.
Why would a variable that's scoped to the enveloping DoWhile activity be implicitly assigned to null? I'm trying to get this to work so I can implement multiple client subscribers from there and work on triggers that invoke callbacks to multiple clients.
CONCAT EDIT: I set a breakpoint at the DoWhile level and my var is null once Unsubscribe() is called. When Subscribe() is invoked, the watch shows a value in the var all the way through. Until I Unsubscribe() with a client. Should I be using a While Activity instead?
Without seeing the workflow I can only make a few guesses but the things I would look for are:
Is the variable scoped to a sequence or something that is inside of the DoWhile activity? BTW there is no benefit ti changing it to a While activity, the only difference is that the condition is tested at the beginning or the end.
Is the variable used somewhere else and cleared that way. Try renaming it and see what gives.
Is there persitence in play and is the type not persisted> I assume its either a string or a Uri and both should be good to go.
Is there a problem with correlation and is your Unsubscribe message being processed by a different workflow? Mare sure the CanCreateInstance is set to false.
try making a class scoped private {get; set;} and see if the problem still rears its head, thats the best I can do without seeing the actual source code as from what you described I cant see any issues.
Wow, ok scary stuff. I had to hand edit the xamlx file earlier and the references I edited for the SendReplyToReceive saved funny when I switched back to the activity designer. It made it look like I had two Unsubscribe()'s and not only that but the correlation handles for each branch were crossing between branches.
I'm all set now. To fix the issue I removed all the messaging activities, dropped in a new ReceiveAndSendReply activity into branch 1's action block. Then I dragged the Receive activity to the Trigger for branch 1 and configured it as I had before. I did the same for branch 2, except I placed the SendReplyToReceive activity below my If activity that validates matching addresses.

Sharepoint Workflow Modification is not disabled

I am working on a Sharepoint Server 2007 State machine Workflow. Until now I have a few states and a custom Association/InitiationForm which I created with InfoPath 2007. In Addition I have a few modification forms. I have a Problem with the removing of the modification link in the state-page of my workflow.
I have a state and in the initialize block of this state my EnableWorkflowModification Activity appears. So at the beginning of the state the modification is active. In the same state I have an OnWorkflowModification activity, which catches the event raised by the EnableWorkflowModification activity. After this state my modification is over and the link should disappear in the state-page. But this is not the case.
Both activities have the same correlation token (modification) and the same owner (the owning state).
Has anybody an idea why the link is not removed and how to remove the modification link?
Thank you in advance, Stefan!
Have you checked the OnWorkflowModification event handler is actually firing? Try debugging or adding some eventlog traces to make sure it is. I've run into similar issues with OnWorkflowItemChanged event handler.
Make sure you have the enableWorkflowModification and onWorkflowModified inside an eventHandlingScopeActivity, and set that as the OwnerActivityName for each.

Resources