Showing results for 
Search instead for 
Do you mean 

Proper way to delete an Activity

Copper Super Contributor
Posts: 112
Country: Australia

Proper way to delete an Activity



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.. 





Bronze Elite Contributor
Posts: 2,119
Country: United_Kingdom

Re: Proper way to delete an Activity

Hi Ozzie,


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!

Vivek Gargav
Caldere Associates Ltd.
My Blog
Posts: 1,163
Country: USA

Re: Proper way to delete an Activity

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.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Super Contributor
Posts: 112
Country: Australia

Re: Proper way to delete an Activity

thanks guys

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

Nickel Elite Contributor
Posts: 937
Country: USA

Re: Proper way to delete an Activity

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?


Copper Super Contributor
Posts: 112
Country: Australia

Re: Proper way to delete an Activity

[ Edited ]

Hi Allen


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?