enableLogging = false; // set to true for debug logging
dumpLogFileName = "_ptCalendar_inc-post-delete-formrecord-hook.cfm";
errorLogFileName = "_ptCalendar_inc-post-delete-formrecord-hook-error.html";
if ( enableLogging )
{
try
{
application.ADF.log.logAppend(msg=attributes, label='attributes post delete form record', logfile=dumpLogFileName);
}
catch ( any expt )
{
WriteDump(expt);
}
}
// set to true to rebuild the FormName/FormID memory cache
resetFormIdMap = false;
try
{
elemtID = '';
// Set the Element ID
if ( StructKeyExists(Attributes, 'FormID') )
elemtID = Attributes.FormID;
if ( IsNumeric(elemtID) )
{
// On Calendar Event Details Deletes: Update the Calendar Cache for EventID
ceFormName = 'Calendar Event Details';
ceFormID = application.ADF.cedata.getFormIDByCEName(CEName=ceFormName);
if ( elemtID EQ ceFormID )
{
processType = 'delete';
idFldName = 'uniqueID';
idFldId = application.ADF.fields.getCEFieldId(ceNameOrID=elemtID,fieldName=idFldName);
idFIC = 'FIC_#elemtID#_#idFldId#';
idValue = '';
if ( StructKeyExists(outputStruct,idFIC) )
idValue = outputStruct[idFIC];
if (TRIM(idValue) NEQ '' )
result = application.ptCalendar.calEventsCacheController.processEventCacheByEventID(eventID=idValue,process=processType); //process: add,update,delete
}
// Check if the current elemtID is a ptCalendar GCE... if so handle it (moved this process to a common module)
//cfmodule(template="inc-hook-common.cfm",elemtID=elemtID,resetFormIdMap=resetFormIdMap);
}
}
catch (any excpt)
{
application.ADF.log.logAppend(msg=excpt, label='ptCalendar-Post-Delete-FormRecord-Error', logfile=errorLogFileName);
rethrow;
}