From b1d39d2a3810a66b401adb3fbbf847fe104061bd Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 23 Jan 2022 20:54:44 +0000 Subject: [PATCH] --- server/AyaNova/biz/FormFieldReference.cs | 2 +- server/AyaNova/biz/RequiredFieldsValidator.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/AyaNova/biz/FormFieldReference.cs b/server/AyaNova/biz/FormFieldReference.cs index 3083bc27..a193e386 100644 --- a/server/AyaNova/biz/FormFieldReference.cs +++ b/server/AyaNova/biz/FormFieldReference.cs @@ -1699,7 +1699,7 @@ namespace AyaNova.Biz //CLIENT Use only for display in customization form to disambiguate things like //Tags in main workorder and Tags in Workorder Item and Tags in Unit (all on same form) - public string TKeySection { get; set; } + public string TKeySection { get; set; }=null; //CLIENT form customization public bool Hideable { get; set; } diff --git a/server/AyaNova/biz/RequiredFieldsValidator.cs b/server/AyaNova/biz/RequiredFieldsValidator.cs index f890c9f1..f83c0569 100644 --- a/server/AyaNova/biz/RequiredFieldsValidator.cs +++ b/server/AyaNova/biz/RequiredFieldsValidator.cs @@ -28,8 +28,9 @@ namespace AyaNova.Biz //get the FormField object FormField FF = FormFields.Where(z => z.FieldKey == FldLtKey).Single(); - //don't validate custom fields, just skip them - if (!FF.IsCustomField) + var proposedObjectType=proposedObject.GetType().ToString(); + //don't validate custom fields, just skip them, make sure if it's sectional it matches the section of the object type (workorder sub sections) + if (!FF.IsCustomField && FF.TKeySection == null || proposedObjectType.EndsWith(FF.TKeySection)) { //Now get the actual property name from the available fields using the lt key string RequiredPropertyName = FF.FieldKey;