enableLogging = false; // set to true for debug logging dumpLogFileName = "_post-save-form-hook.html"; errorLogFileName = "_post-save-form-hook-error.html"; if ( enableLogging ) application.ADF.log.logAppend(msg=attributes, label='attributes', logfile=dumpLogFileName); try { // Init POST-save-form-hook vars elemtName = ''; elemtID = ''; dataPageID = 0; newRecord = false; if( StructKeyExists(attributes,'inputStruct') ) { // Set the Element ID if ( StructKeyExists(attributes.inputStruct, 'controlTypeID') ) elemtID = attributes.inputStruct.controlTypeID; else if ( StructKeyExists(attributes.inputStruct, 'FormID') ) elemtID = attributes.inputStruct.FormID; // Set the dataPageID for the current record if ( StructKeyExists(attributes.inputStruct, 'dataPageID') ) dataPageID = attributes.inputStruct.dataPageID; else if( StructKeyExists(attributes.inputStruct, 'savePageID') ) dataPageID = attributes.inputStruct.savePageID; else if( StructKeyExists(attributes.inputStruct, 'PageID') ) dataPageID = attributes.inputStruct.pageid; else dataPageID = 0; // Set the NewRecord flag if ( StructKeyExists(attributes.inputStruct,'newData') ) newRecord = attributes.inputStruct.newData; outputStruct = Duplicate( attributes.inputStruct ); if ( IsNumeric(elemtID) ) { elemtName = application.ADF.ceData.getCENameByFormID(elemtID); switch( elemtName ) { case "{{REPLACE WITH A CE NAME}}": // ADD POST SAVE LOGIC SPECIFIC TO THIS CE // Get Unique field ID and build the FIC name idFldID = application.ADF.fields.getCEFieldId(ceNameOrID=elemtID, fieldName='ID'); idFIC = 'FIC_#elemtID#_#idFldID#'; UniqueID = ""; if ( StructKeyExists( outputStruct, idFIC ) ) UniqueID = outputStruct[idFIC]; break; case "{{REPLACE WITH ANOTHER CE NAME}}": // ADD POST SAVE LOGIC SPECIFIC TO THIS CE break; } } else { // // METADATA FORMS // -- since no elemtID (FormID or ControlTypeID) was passed in then we are working with Metadata forms/fields // // Make sure we have a dataPageID which is actually the CSPageID since we will be working with a metadata form if ( dataPageID GT 0 ) { } } } } catch (any excpt) { application.ADF.utils.logAppend(msg=excpt, label='Post-Save-Error', logfile=errorLogFileName); rethrow; }