Newer
Older
Pascal Neub
committed
import("system.translate");
import("Util_lib");
import("system.result");
import("system.vars");
import("Attribute_lib");
Pascal Neub
committed
if(vars.get("$field.AB_ATTRIBUTE_ID") && !AttributeRelationUtils.validateSingleCount(
vars.get("$param.ObjectType_param"),
vars.get("$param.ObjectRowId_param"),
vars.get("$field.AB_ATTRIBUTE_ID")
)) {
result.string(translate.text("Invalid attribute count"));
}
else
{
var attributeType = AttributeTypes.get(vars.get("$field.ATTRIBUTE_TYPE"));
if (attributeType && !attributeType.useLookup)
{
var validationResult = attributeType.validateValue(vars.get("$local.value"), Utils.parseJSON(vars.get("$field.VALIDATIONPARAMETERS")));
if (validationResult && validationResult !== true)
Pascal Neub
committed
{
Pascal Neub
committed
}
}