Function that vanishes

Hi, this is our code.

/**
 * @properties={typeid:24,uuid:"8A3E94FC-34DB-4F76-846B-2B1D5BFC6428"}
 * @AllowToRunInFind
 */
function initializeValidationForThisForm(formName) {

	// Get the correspondent dtl name for the incoming tbl form
	var dtlFormName = formName.replace('_tbl', '_dtl');

	// If we have dtl
	if (forms[dtlFormName] != null) {

		var validationFunction = globals.getValidationFunctionForThisForm(dtlFormName);
		//history.removeForm(dtlFormName);
		//solutionModel.removeForm(dtlFormName);
		var formSM = solutionModel.getForm(dtlFormName);

		if (formSM != null) {
			if (formSM.getFormMethod("validateFields") == null) {
				var method = formSM.newFormMethod(validationFunction);
				formSM.onElementFocusLost = method;
				plugins.Log.debug('------------------------------');
				plugins.Log.debug('entro en ' + formName);
				plugins.Log.debug('------------------------------');
				plugins.Log.debug(validationFunction);
			}
		}

		// Finally, set the same foundset to the recent recreated form from his 'brother', the _tbl one
		forms[dtlFormName].controller.recreateUI();
		forms[dtlFormName].controller.loadRecords(forms[formName].foundset);
	}
}

The question is this when we use: “//history.remove From(dtl FormName); //solutions Model.removeForm(dtlFormName);”

It works but, we have some problems and we want try use this command: “forms[dtlFormName].controller.recreateUI();”

But if we do that Servoy says that can’t find the function “validateFields” and we know this function exist and it is created correctly, some help for know to do?

In advance, thanks for all!