You need to sign in to do that
Don't have an account?
Kishore B T 21
how to avoid the de-duplicate event
I have an event on 12/31/2015 10:00 AM and ends at 12/31/2015 11:00 AM.
But I can compare the datetime with Greater than or equal to
select Id, Subject, isAllDayEvent, StartDateTime, EndDateTime,venue__c from Event where startdatetime >= 2015-12-29T01:30:00.000+0000,
But i want to do the same with Less than or equal to or even Less than it's not working.
Please, someone, guide me on this to avoid de-duplication of event,
should give error msg when user, is trying to create a event in between of startdatetime and enddatetime of a created event.
Here's how you *might* structure your query to check for duplicate events:
The query uses logical functions to check for the following situations:
- If the start date of the new event is during an existing event, but the end date is afterward.
- If the start date of the new event is before an existing eent, but the end date is during the existing event
- If the start date of the new event is before the existing event, and after the existing event.
Of course you might have to tweak it a bit, especially if you're worried about stuff like timezones.However, that should at least get you started.
The "trick" widely accepted is to put the date comparison into a formula, and then "stick" the date in question into a field (referenced by that formula) and you can the run a SOQL query over the formula field (ie. add a field called event_create_date__c which you check against startdatetime and enddatetime in a seperate formula (which can be a checkbox) and then in your code, stuff the date value into event_create_date__c and then SOQL against the formula).
I don't think I have made that very clear at all..
This is how my calender looks.
this is my VF Page
and my controller
I have tried the snippet what you have given me, but it's the alternate form of startdatetime==e.startdatetime.
it's matching only equals condition.