	// ===============================================================
	// EditHandler Flags
	// ===============================================================	
	
	function HTTP_LOAD()
	{
		// Escape if new item
		// ...........................................
		if(JSRC_FLAG.IS_NULL_BIGINT(PROPERTY_ACC_TRAIL_ID, 1, 1))
		{
			return;
		}
		
		
		// Load DB data of item
		// ...........................................
		JSOC_DIALOG.VAR_LOADING_SPINNER(true);
		JSCUS_SQL._ACCOUNT._AUDIT_TRAIL.CUS_GET_THEN_POPULATE_FORM
		(
			function(){CUS_SEND_DIALOG_TRY_DISMISS();},
			
			"AUDIT_TRAIL_MODAL", 
			FLAG_TINYINT_NULL, 
			PROPERTY_ACC_TRAIL_ID
		);
		
		
		// Clear Changes due to loading
		// ...........................................
		
	}


	// ===============================================================
	// Trims empty spaces and perform convertion for numeric fields.
	// ===============================================================
	function FIX_INPUT()
	{
		// Fix String Fields
		// ...........................................
		JSOC_INPUT_TEXT.CTL_TRIM(ACC_TRAIL_REQUEST_IP_ADDRESS_TXT);
		JSOC_INPUT_TEXT.CTL_TRIM(ACC_TRAIL_DESCRIPTION_TXT);
		JSOC_INPUT_TEXT.CTL_TRIM(ACC_TRAIL_PARAMETERS_TXT);
		JSOC_INPUT_TEXT.CTL_TRIM(ACC_TRAIL_UNIQUE_SESSION_ID_TXT);
		
		
		// Fix Numeric Fields (if field type is not number.)
		// ...........................................
			JSOC_INPUT_TEXT.CTL_NVAL(ACC_TRAIL_TARGET_ID_TXT);
			JSOC_INPUT_TEXT.CTL_NVAL(ACC_TRAIL_TARGET_SERVER_ID_TXT);


		// Fix Password Fields
		// ...........................................
	}

		
	// ===============================================================
	// Request Save
	// ===============================================================
	function HTTP_SAVE(CALLBACK_METHOD)
	{

		// Sanitize User Inputs
		// _______________________________________________________________________
		FIX_INPUT();
	
	
		// Check Edit Status
		// _______________________________________________________________________
		if(EDIT_HANDLER.REF_IS_MODIFIED == false)
		{
			JSVC_INFO.VAR_NOTHING_TO_SAVE(function(){CALLBACK_METHOD(false);})	
			return;		
		}


		// Validate Null [String Input]
		// _______________________________________________________________________
		if(JSOC_INPUT_TEXT.CTL_VALIDATE(ACC_TRAIL_REQUEST_IP_ADDRESS_TXT, "IP Address", null, 1, 500) == false)
		{
			return false;
		}
		if(JSOC_INPUT_TEXT.CTL_VALIDATE(ACC_TRAIL_DESCRIPTION_TXT, "Description", null, 1, 16000) == false)
		{
			return false;
		}
		if(JSOC_INPUT_TEXT.CTL_VALIDATE(ACC_TRAIL_PARAMETERS_TXT, "Changes Made", null, 1, 16000) == false)
		{
			return false;
		}
		if(JSOC_INPUT_TEXT.CTL_VALIDATE(ACC_TRAIL_UNIQUE_SESSION_ID_TXT, "Session Information", null, 1, 16000) == false)
		{
			return false;
		}
		
		
		// Validate Zero [Numeric Input]
		// _______________________________________________________________________
		if(JSOC_INPUT_TEXT.CTL_NVAL(ACC_TRAIL_TARGET_ID_TXT) == 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Target Record\'s ID cannot be zero(0).', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					ACC_TRAIL_TARGET_ID_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);		
			return;		
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(ACC_TRAIL_TARGET_SERVER_ID_TXT) == 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Target Server\'s ID cannot be zero(0).', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					ACC_TRAIL_TARGET_SERVER_ID_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);		
			return;		
		}
	
	
		// Validate Negative [Numeric Input]
		// _______________________________________________________________________
		if(JSOC_INPUT_TEXT.CTL_NVAL(ACC_TRAIL_TARGET_ID_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Target Record\'s ID cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					ACC_TRAIL_TARGET_ID_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if(JSOC_INPUT_TEXT.CTL_NVAL(ACC_TRAIL_TARGET_SERVER_ID_TXT) < 0)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Target Server\'s ID cannot be negative.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					ACC_TRAIL_TARGET_SERVER_ID_TXT.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		
		
		// Validate Range [Numeric Input]
		// _______________________________________________________________________	


		// Foreign key check
		// _______________________________________________________________________
		if
		(
			JSVC_VAR.VAR_ISSET(ACC_TRAIL_SYS_METHOD_ID_CMB) &&
			JSOC_CMB.VAR_SELECTED_INDEX(ACC_TRAIL_SYS_METHOD_ID_CMB) < 0
		)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Audit Method is required.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					ACC_TRAIL_SYS_METHOD_ID_CMB.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if
		(
			JSVC_VAR.VAR_ISSET(ACC_TRAIL_ACC_DEVICE_ID_CMB) &&
			JSOC_CMB.VAR_SELECTED_INDEX(ACC_TRAIL_ACC_DEVICE_ID_CMB) < 0
		)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Device used is required.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					ACC_TRAIL_ACC_DEVICE_ID_CMB.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if
		(
			JSVC_VAR.VAR_ISSET(ACC_TRAIL_ACC_ACCOUNT_ID_CMB) &&
			JSOC_CMB.VAR_SELECTED_INDEX(ACC_TRAIL_ACC_ACCOUNT_ID_CMB) < 0
		)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Account ID is required.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					ACC_TRAIL_ACC_ACCOUNT_ID_CMB.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		if
		(
			JSVC_VAR.VAR_ISSET(ACC_TRAIL_SYS_MODULE_ID_CMB) &&
			JSOC_CMB.VAR_SELECTED_INDEX(ACC_TRAIL_SYS_MODULE_ID_CMB) < 0
		)
		{
			JSOC_DIALOG.VAR_MESSAGE_BOX
			(
				'Field Processed Module is required.', 
				'Information',
				'OK', 'WARNING',
				function(MESSAGE_RESPONSE)
				{
					ACC_TRAIL_SYS_MODULE_ID_CMB.focus();
					CALLBACK_METHOD(false);
				}
			);	
			return;			
		}
		

		// Validate Duplicates
		// _______________________________________________________________________
		var EXCEPTION_ROW_INDEX = -1;
		if(PROPERTY_ACC_TRAIL_ID >= 0)
		{
			EXCEPTION_ROW_INDEX = PROPERTY_EDIT_ROW_INDEX;
		}
			

		
		
		// Password Items (if available)
		// _______________________________________________________________________
		
		
		// CheckBox Items (if available)
		// _______________________________________________________________________
			

		
		// Save item [Prepare]
		// _______________________________________________________________________
		var SAVE_MAP_ARRAY = JSCUS_SQL._ACCOUNT._AUDIT_TRAIL.CUS_PREPARE_MAPPED_ARRAY_FOR_SAVE();
		// JSVC_MAP_ARRAY.VAR_SET(GET_MAP_ARRAY, 'PARAM_PARENT_ID', PROPERTY_PARENT_ID));		// Parent ID Sample
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_ID", PROPERTY_ACC_TRAIL_ID);				
		
			
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_REQUEST_IP_ADDRESS", JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_REQUEST_IP_ADDRESS_TXT));					
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_SYS_METHOD_ID", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(ACC_TRAIL_SYS_METHOD_ID_CMB)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_ACC_DEVICE_ID", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(ACC_TRAIL_ACC_DEVICE_ID_CMB)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_ACC_ACCOUNT_ID", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(ACC_TRAIL_ACC_ACCOUNT_ID_CMB)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_PROXY_USER", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(ACC_TRAIL_PROXY_USER_CMB)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_ACC_SERVER_ID", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(ACC_TRAIL_ACC_SERVER_ID_CMB)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_SYS_MODULE_ID", JSVC_NUM.VAR_NVALL(JSOC_CMB.VAR_SELECTED_VALUE(ACC_TRAIL_SYS_MODULE_ID_CMB)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_TARGET_ID", JSVC_NUM.VAR_NVALL(JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_TARGET_ID_TXT)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_TARGET_SERVER_ID", JSVC_NUM.VAR_NVALL(JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_TARGET_SERVER_ID_TXT)));
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_DESCRIPTION", JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_DESCRIPTION_TXT));					
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_PARAMETERS", JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_PARAMETERS_TXT));					
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_TIMESTAMP", JSVC_DATE.VAR_FORMAT(JSVC_DATE.VAR_END_OF_DAY(JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_TIMESTAMP_DTP)), "YYYY-MM-DD HH:mm:ss") + '.999999');
		JSVC_MAP_ARRAY.VAR_SET(SAVE_MAP_ARRAY, "PARAM_ACC_TRAIL_UNIQUE_SESSION_ID", JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_UNIQUE_SESSION_ID_TXT));					
		
		
		// Declare Post Request Handler
		// _______________________________________________________________________
		var RESPONSE_HANDLER = 			
			function(IS_SUCCESS, HTTP_RESPONSE)
			{
				// Handle Error
				// ...........................................
				if(IS_SUCCESS === false)
				{
					METHOD_UNABLE_TO_SEND_REQUEST(CALLBACK_METHOD);	
					return;
				}
				
				// Catch JSON Error
				// ...........................................
				else if(JSRC_JSON.REF_IS_JSTRING(HTTP_RESPONSE) == false)
				{
					METHOD_SERVER_ISSUE(CALLBACK_METHOD, HTTP_RESPONSE);
					return;			
				}
					
				// Read Response
				// ...........................................
				else
				{
					// Load Response
					var JSON_OBJECT = JSRC_JSON.REF_CREATE(HTTP_RESPONSE);
					if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
					{
						METHOD_REQUEST_FAILURE(CALLBACK_METHOD, JSON_OBJECT);
						return;
					}
					
			
					// Post Save Action
					else
					{
						// Retrieve Inserted ID
						PROPERTY_ACC_TRAIL_ID = JSRC_JSON.REF_READ(JSON_OBJECT, "INSERTED_ID");
						
						// Update Changes to DataGridView
						if(PROPERTY_ACC_TRAIL_ID > 0)
						{
							JSOC_DGV_CELL.VAR_VALUE 
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_REQUEST_IP_ADDRESS", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_REQUEST_IP_ADDRESS_TXT),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_SYS_METHOD_ID", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_CMB.VAR_SELECTED_TEXT(ACC_TRAIL_SYS_METHOD_ID_CMB),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_ACC_DEVICE_ID", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_CMB.VAR_SELECTED_TEXT(ACC_TRAIL_ACC_DEVICE_ID_CMB),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_ACC_ACCOUNT_ID", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_CMB.VAR_SELECTED_TEXT(ACC_TRAIL_ACC_ACCOUNT_ID_CMB),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_PROXY_USER", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_CMB.VAR_SELECTED_TEXT(ACC_TRAIL_PROXY_USER_CMB),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_ACC_SERVER_ID", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_CMB.VAR_SELECTED_TEXT(ACC_TRAIL_ACC_SERVER_ID_CMB),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_SYS_MODULE_ID", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_CMB.VAR_SELECTED_TEXT(ACC_TRAIL_SYS_MODULE_ID_CMB),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE 
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_TARGET_ID", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_TARGET_ID_TXT),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE 
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_TARGET_SERVER_ID", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_TARGET_SERVER_ID_TXT),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE 
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_DESCRIPTION", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_DESCRIPTION_TXT),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE 
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_PARAMETERS", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_PARAMETERS_TXT),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE 
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_TIMESTAMP", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSVC_DATE.VAR_FORMAT
									(
										JSVC_DATE.VAR_TO_DATE
										(
											JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_TIMESTAMP_DTP)
										),
										'MMMM DD, YYYY'
									),
									true
								);
							JSOC_DGV_CELL.VAR_VALUE 
								(
									AUDIT_TRAIL_DGV,
									"ACC_TRAIL_UNIQUE_SESSION_ID", 
									PROPERTY_EDIT_ROW_INDEX, 
									JSOC_ELEMENT.VAR_VALUE(ACC_TRAIL_UNIQUE_SESSION_ID_TXT),
									true
								);
						}
						else
						{
							HTTP_SEARCH();
						}	

						// Lift edit and Exit EditMode
						EDIT_HANDLER.REF_IS_MODIFIED = false;
						EDIT_HANDLER.HAS_NEWLY_SAVED_DATA = true;			
						if(JSOC_ELEMENT.VAR_ELEMENT_EXISTS('AUDIT_TRAIL_MODAL') == true)
						{
							JSOC_DIALOG.VAR_MODAL('AUDIT_TRAIL_MODAL', false);
						}
						
						//SWAP_EDIT_MODE(false);
						CALLBACK_METHOD(true);											
					}
				}
			};
			
			
		// Save Item [Send Request]
		// _______________________________________________________________________
		JSCUS_SQL._ACCOUNT._AUDIT_TRAIL.CUS_SAVE 
		(
			SAVE_MAP_ARRAY,
			RESPONSE_HANDLER
		);
		
	}
	
	
	function HTTP_DELETE(CALLBACK_METHOD, ROW_INDEX)
	{
		// Escaper if Disabled
		// _______________________________________________________________________
		if(JSVC_VAR.VAR_ISSET(DELETE_BBI) && DELETE_BBI.Enabled == false)
		{
			CALLBACK_METHOD(false);
			return;
		}

		// Escape if nothing selected
		// _______________________________________________________________________
		if(ROW_INDEX < 0)
		{
			JSVC_ERROR.VAR_ARGUMENT_EXCEPTION_NOTHING_SELECTED(true);
			CALLBACK_METHOD(false);
			return;
		}
		
		// Initialize
		// _______________________________________________________________________
		var DELETE_ITEM_DESCRIPTION = AUDIT_TRAIL_DGV.CELL.VALUE('ACC_TRAIL_DESCRIPTION', ROW_INDEX);
		
		
		
		// Declare Post Request Handler
		// _______________________________________________________________________
		var RESPONSE_HANDLER = function
		(
			IS_SUCCESS, 
			HTTP_RESPONSE
		)
		{
			// Disable Dialogs
			// ...........................................
			CUS_SEND_DIALOG_TRY_DISMISS();
				
				
			// Handle Error
			// ...........................................
			if(IS_SUCCESS === false)
			{
				METHOD_UNABLE_TO_SEND_REQUEST(CALLBACK_METHOD);
				return;
			}
			
			// Catch JSON Error
			// ...........................................
			else if(JSRC_JSON.REF_IS_JSTRING(HTTP_RESPONSE) == false)
			{
				METHOD_SERVER_ISSUE(CALLBACK_METHOD, HTTP_RESPONSE);
				return;			
			}
			
			
			// Read Response
			// ...........................................
			else
			{
				// Load Response
				var JSON_OBJECT = JSRC_JSON.REF_CREATE(HTTP_RESPONSE);
				if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
				{
					METHOD_REQUEST_FAILURE(CALLBACK_METHOD, JSON_OBJECT);
					return;
				}
				
				// Post Delete Action
				else
				{
					AUDIT_TRAIL_DGV.ROW.REMOVE_AT(ROW_INDEX);
					AUDIT_TRAIL_DGV.COLUMN.ROW_COUNT_PRINT('ROW_COUNT');
					JSVC_INFO.VAR_RECORD_DELETED
					(
						DELETE_ITEM_DESCRIPTION, 
						function()
						{
							CALLBACK_METHOD(true);
						}
					);		
				}
			}
		};
		
		
		// Request User Verification for Delete
		// _______________________________________________________________________
		JSVC_INFO.VAR_VERIFY_DELETE
		(
			DELETE_ITEM_DESCRIPTION,
			function(VERIFY_RESULT) 
			{
				// Abort if rejected by user.
				// ...........................................
				if(VERIFY_RESULT != JSOC_DIALOG.MSGBOX_YES)
				{

					CALLBACK_METHOD(false);
					return;
				}
				
				
				//Delete Item
				// ...........................................
				JSOC_DIALOG.VAR_LOADING_SPINNER(true);
				JSCUS_SQL._ACCOUNT._AUDIT_TRAIL.CUS_DELETE
				(
					AUDIT_TRAIL_DGV.CELL.VALUE('ACC_TRAIL_ID', ROW_INDEX),
					RESPONSE_HANDLER
				)
			}
		);
	}