var retStr = "Failed"; var dateTimeStamp = Now(); // Get the generated Events records from the Event Element and the Event datetime properties var dataQry = application.ptCalendar.calEventsDAO.getEventsUnion( startDate=arguments.startDate ,endDate=arguments.endDate ); //application.ptCalendarCache.events = dataQry; retStruct = writeCacheData(cacheQry=dataQry,dateTimeStamp=dateTimeStamp); if ( StructKeyExists(retStruct,"msg") ) retStr = retStruct.msg; return retStr; var retStr = "false"; var memResult = deleteCacheData(); var keyResult = removeCacheDataKeys(); // Remove the ptCalendarCache events key //if ( StructKeyExists(application.ptCalendarCache,"events") ) // StructDelete(application.ptCalendarCache,"events"); // Remove the ptCalendarCache eventsCacheUpdateDateTime key //if ( StructKeyExists(application.ptCalendarCache,"eventsCacheUpdateDateTime") ) // StructDelete(application.ptCalendarCache,"eventsCacheUpdateDateTime"); if ( StructKeyExists(memResult,"MSG") ) retStr = memResult.MSG; return retStr; // Get the events records from application.ptCalendarCache.events data cache; return readCacheData(); SELECT cachedEventsQry.* FROM cachedEventsQry UNION SELECT newEventsQry.* FROM newEventsQry ORDER BY eventDate, AllDay DESC, StartTime if ( NOT StructKeyExists(application,"ptCalendarCache") ) application.ptCalendarCache = StructNew(); application.ptCalendarCache.recurrence = cachedRecurQry; //application.ptCalendarCache.recurrenceCacheUpdateDateTime = dateTimeStamp; return true; ---> var retStruct = StructNew(); var retFlag = false; var dateTimeStamp = Now(); var dataQry = QueryNew("temp"); var cachedEventQry = getEvents(); // QofQ of the Cached Event Records //var cachedEventQry = application.ptCalendarCache.events; // This would be without IsQuery protection // Generate the LIVE unCached events records var newEventsQry = application.ptCalendar.calEventsDAO.getEventsByEventID( eventID=arguments.eventID, useCache=false ); SELECT cachedEventQry.* FROM cachedEventQry UNION SELECT newEventsQry.* FROM newEventsQry ORDER BY eventDate, AllDay DESC, StartTime retStruct = writeCacheData(cacheQry=cachedEventQry,dateTimeStamp=dateTimeStamp); if ( StructKeyExists(retStruct,"status") ) retFlag = retStruct.status; return retFlag; //application.ptCalendarCache.events = cachedEventQry; //application.ptCalendarCache.eventsCacheUpdateDateTime = dateTimeStamp; //return true; var dateTimeStamp = Now(); // Remove events cache records by EventID var deleteEvents = deleteEventCacheRecord( eventID=arguments.eventID ); // Create new events cache records by EventID var addEvents = addEventCacheRecord( eventID=arguments.eventID ); //Updating the timestamp and data is handled by the add and delete functions return true; var retStruct = StructNew(); var retFlag = false; var dateTimeStamp = Now(); var dataQry = QueryNew("temp"); var cachedEventQry = getEvents(); // QofQ of the Cached Event Records //var cachedEventQry = application.ptCalendarCache.events; // This would be without IsQuery protection SELECT * FROM cachedEventQry WHERE 1 = 1 AND calEventID <> ORDER BY eventDate, AllDay DESC, StartTime retStruct = writeCacheData(cacheQry=cachedEventQry,dateTimeStamp=dateTimeStamp); if ( StructKeyExists(retStruct,"status") ) retFlag = retStruct.status; //application.ptCalendarCache.events = cachedEventQry; //application.ptCalendarCache.eventsCacheUpdateDateTime = dateTimeStamp; //retStruct.status = true; //retStruct.msg = "Success"; var retStruct = StructNew(); var dateTimeStamp = Now(); var cachedQry = QueryNew('temp'); retStruct = writeCacheData(cacheQry=cachedQry,dateTimeStamp=dateTimeStamp); //application.ptCalendarCache.events = cachedQry; //application.ptCalendarCache.eventsCacheUpdateDateTime = dateTimeStamp; //retStruct.status = true; //retStruct.msg = "Success"; return retStruct; // Get the cache records from application.ptCalendarCache.events; if ( StructKeyExists(application,"ptCalendarCache") AND StructKeyExists(application.ptCalendarCache,"events") AND IsQuery(application.ptCalendarCache.events) ) retQry = application.ptCalendarCache.events; var retStruct = StructNew(); if ( NOT StructKeyExists(application,"ptCalendarCache") ) application.ptCalendarCache = StructNew(); application.ptCalendarCache.events = arguments.cacheQry; application.ptCalendarCache.eventsCacheUpdateDateTime = arguments.dateTimeStamp; retStruct.status = true; retStruct.msg = "Success"; return retStruct; // Remove the ptCalendarCache events key if ( StructKeyExists(application.ptCalendarCache,"events") ) StructDelete(application.ptCalendarCache,"events"); // Remove the ptCalendarCache eventsCacheUpdateDateTime key if ( StructKeyExists(application.ptCalendarCache,"eventsCacheUpdateDateTime") ) StructDelete(application.ptCalendarCache,"eventsCacheUpdateDateTime"); retStr = true;