[Calendar Plugin] Delete Event

[Calendar Plugin] Delete Event

  
Forge Component
(1)
Published on 2016-12-15 by OutSystems R&D
1 vote
Published on 2016-12-15 by OutSystems R&D

Hi,


I am trying to use this plugin and I am having some trouble with the deletion of them. So I can remove an event if I, specifically, insert a date, like "#2017-01-01#". By using the 

SyntaxEditor Code Snippet

BuildDateTime(AddDays(CurrDate(),-2),#00:02:00#)

I verify that events are not deleted. Besides this, if my end date is CurrDateTime() or tomorrow, the futures events aren't deleted even if I insert a specific date.


I would like to receive some suggestions or if it's really a bug I would like to know when it's available to be used correctly.


Best Regards.

Hello, Catarina,

Could you be a bit more specific on what you're trying to do? 

I take it you are scheduling the event to the given date: but is it the end or the start date? When deleting, are you using the same criteria? Are you using extra criteria, such as the title/locations/note? Can you find the event using FindEvent?

If you have a specific case where it's failing, that would be great to troubleshoot. :)

Best regards,

Carlos Simões

Carlos Simões wrote:

Hello, Catarina,

Could you be a bit more specific on what you're trying to do? 

I take it you are scheduling the event to the given date: but is it the end or the start date? When deleting, are you using the same criteria? Are you using extra criteria, such as the title/locations/note? Can you find the event using FindEvent?

If you have a specific case where it's failing, that would be great to troubleshoot. :)

Best regards,

Carlos Simões

Hello Carlos,


I want to create an event, every time I open the app, for tomorrow and delete the previous events existing in the calendar. So I can find the events, I can create them but when I want to delete them for like 3 days before today, with that title, I cannot do that. But I understood that the problem was in using BuildDateTime. I ended up using this 

AddDays(CurrDateTime(),-2)

and I was able to delete the events.


Best Regards,

Catarina Carvalho

Glad you worked it out, Catarina. Did you try deleting without a date (only using a prefix, through the Title parameter)?

The StartDateTime and the EndDateTime are mandatory, so I couldn't try to delete just by title.

Ah, you're absolutely right: even the Git Hub plugin references this limitation.

Got it. Thanks for the feedback, Catarina!

Hi,

I'm also having some issues deleting events. I will try to explain the issue with an example.

I have created an event (CreateEvent action) with the following example data:

Title: "Event 1"

StartDateTime: MyStartDateTime

EndDateTime: MyEndDateTime

The event was successfully created in the device's calendar. After that, I have tried to find the event (FindEvent action) with the same data and it was found. Everything was going well until I try to delete the event. When I try to delete the event (DeleteEvent action) with the same data, the event was not deleted.

Then, just for test purposes, I have tried to delete the event using the same title but using AddHours(MyStartDateTime, -1) in the parameter StartDateTime and AddHours(MyEndDateTime, 1) in the parameter EndDateTime. The event was not deleted either.

I did one more test: I have tried to delete the event using the same title and using AddDays(MyStartDateTime, -1) in the parameter StartDateTime and AddDays(MyEndDateTime, 1) in the parameter EndDateTime. This time the event was successfully deleted.

Although the last solution works, it isn't suitable for me since I want to use the first approach but apparently it doesn't work. Otherwise, if I use the last solution, if I have 2 events in the same day with the same name, the DeleteEvent action will delete both events instead of just the one that I want to delete.


Any feedback on this issue would be greatly appreciated.


Best regards,

André Dinis

Hi,

I've found out where the problem comes from.

The DeleteEvent action takes as input parameters the start date and end date as DateTime. However the JavaScript of the action takes the same parameters as Date, so it does not take into account the Time. If you change the data type of those parameters to DateTime, it works.


Best regards,

André Dinis

Thanks André Dinis. I was having this issue and your solution fixed it.