07-02-2010 06:22 AM
I am trying to delete an activity, and my code seems to work, yet when i look in within the ACT program the activity is still displayed, but when you click the item an error "retrieving the owner of the activity....."
i am using this code:
ActFwk.Activities.DeleteActivity(_activity, _activity.Organizer, False)
ActFwk.Activities.DeleteActivity(_activity, Nothing, False) <--this one fails thou
what am i doing wrong.. i have searched through the forums and found a few places where this has been discussed but there didnt seem to be any resolution for why this happens..
All i am trying to do is delete one Activity.. any code on how to do this would be great..
07-02-2010 07:56 AM
I've had problems in the past with Activities. One of the things to check and make sure is that the user you are logged in as, has been given Calendar Access by the user whose activity you are trying to delete. This has got me so many times in the past!
07-02-2010 08:33 AM
I think the issue here is just a matter of access via the framework. I can delete the activity basically the same way your doing it, but it's not removed from the view until you open and close the deleted activities dialog box.
However if I do the same, except via a plugin, the activity is removed and the UI is updated properly.
07-02-2010 04:14 PM
now i know since there is only one user that the user has full access to the calendar.. so that cant be the problem
but Matt you are on the right track.. in a plugin the code works find, but this coz is running via a website accesses via the framework..
Closing ACT down and reopening it i see the activity is not being displayed, but the question is is it really gone?? if i change the day view and then return to that day, its still there... i guess i am going to have to create a new empty DB and test.. i know in the old ACT!6 when this happened there used to be errors in the DB coz the activity was still kinda there..
where do i find the "open and close the deleted activities dialog box" ??
Do i have to call some other code first to remove the owner before deleting the activity??
there is no way i can have it that once its deleted on the webpage, that he still gets an error within ACT it self
07-02-2010 05:17 PM
What you describe seems like it would be a framework caching issue - can you use something like the OLEDB Provider to check for the activity record after you've deleted it from your other framework instance? What happens if you refresh the client, or restart the ACT! client - is the Activity record still there?
07-02-2010 08:00 PM - edited 07-02-2010 08:10 PM
i should re-write that last reply by me for that it makes more sense
basically a webapp using the framework displays a list of activities and the user can select one to delete it..
the web then deletes the activity and from what i think it would be gone
but if a user at the time the webapp was deleting the activity had ACT open and running looking at the calendar, the appointment stays visible.. the main problem is that is the user click the activity a msgbox opens stating something about the owner is not linked or something (see below)
while in calendar view changing to the next day, then changing back, the deleted appointment is still visible and again if clicked an error box..(cant open to view the activity at all either, just the error box)
now i didnt try going to another view then back to calendar to see what happens.. but i do know that closing ACT! down and starting it back up the appointment was no longer being displayed in the calendar view
my main other concern (which i will test) is that is it really deleted.. maybe its just not being displaied because of the owner error but is still in the db.. this is will test out
i really just want to know using framework the correct steps of code to delete the activity so that the user in ACT will not get any errors if he clicks it.
As i think the activity is deleted ok, how long is it before the ACT UI does a refresh to know its gone?