This commit is contained in:
2019-01-16 18:48:16 +00:00
parent fe6827be7a
commit c9bc5a6227
2 changed files with 21 additions and 1 deletions

View File

@@ -399,8 +399,17 @@ namespace AyaNova.Biz
AddError(ValidationErrorType.InvalidValue, "Roles");
}
CustomFieldsValidator.Validate(this, ct.FormCustom.SingleOrDefault(x => x.FormKey == FormAvailableFields.WIDGET_FORM_KEY), proposedObj.CustomFields);
//Any form customizations to validate?
var FormCustomization = ct.FormCustom.SingleOrDefault(x => x.FormKey == FormAvailableFields.WIDGET_FORM_KEY);
if (FormCustomization != null)
{
//Yeppers, do the validation, there are two, the custom fields and the regular fields that might be set to required
//validate users choices for required non custom fields
//validate custom fields
CustomFieldsValidator.Validate(this, FormCustomization, proposedObj.CustomFields);
}
return;
}

View File

@@ -7,6 +7,17 @@ using System.ComponentModel.DataAnnotations;
namespace AyaNova.Models
{
/*
- Like DataFilter, holds a JSON fragment in one field and the form key in another field
- JSON FRAGMENT holds items that differ from stock, Hide not valid for non hideable core fields
- FieldKey "fld"
- Hide "hide"
- Required "required"
- Type One of values from AyDataType but not tags or enum (bool, date, date time, decimal, number, picklist(FUTURE), and text)
- e.g.: {template:[{fld:"ltkeyfieldname",hide:"true/false",required:"true/false", type:"bool"},{fld:"ltkeyfieldname",hide:"true/false",required:"true/false", type:"text"]}
*/
public partial class FormCustom
{
public long Id { get; set; }