Issue | Unable to create Questionnaire or Application record.
When setting a Date field's Default Value to a Specific Date, the date value is cleared after saving changes. The date value is most likely in the dd/MM/yyyy format or non-US format.
<Exception> <ExceptionType>System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType> <Message>Nullable object must have a value.</Message> <Source>ArcherTech.Kernel</Source> <StackTrace> at ArcherTech.Kernel.Utility.ContentHelper.GetDefaultDate(ExtendedSessionContext extendedSessionContext, DateTimeFieldDefinition dateDef) at ArcherTech.Kernel.Utility.ContentHelper.CalculateDefaultValues(ExtendedSessionContext extendedSessionContext, IEnumerable`1 contents, IEnumerable`1 fieldDefs, Func`2 getValueListValuesDelegate, Func`2 getAvailableForSelectionGroupsDelegate) at ArcherTech.Kernel.Brokers.SetDefaultValuesTask.Execute(ContentContext contentContext) at ArcherTech.Kernel.Brokers.TaskExecutionHelper.ExecuteTasks[T](T contentContext, IList`1 tasks) at ArcherTech.Kernel.Brokers.ContentBroker.ExecuteContentSavePlan(ContentContext contentContext, IDictionary`2 indexMap, ContentSavePerformanceData performanceData, BatchContentSaveResult returnResults) at ArcherTech.Kernel.Brokers.ContentBroker.Save(IList`1 contentContainers, Nullable`1 subformFieldId, ContentSaveOptions saveOptions) at ArcherTech.Kernel.Brokers.ContentBroker.Save(ContentContainer content, Nullable`1 subformFieldId, ContentSaveOptions saveOptions) at ArcherTech.Kernel.Managers.ContentViewEditManager.InsertQuestionnaireContent(SessionContext sessionContext, ContentContainer content) at ArcherTech.Web.Modules.GenericContent.Views.RecordPresenter.SaveQuestionnaireTarget() at ArcherTech.Web.Modules.GenericContent.Views.RecordPresenter.OnViewLoaded() at ArcherTech.Web.ArcherTechPage`2.OnLoad(EventArgs e) at Security2000.GenericContent.Record.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</StackTrace> </Exception>
|
Resolution | - Run the following SQL script against the Instance database to find the problematic fields:
select mt.module_name, ft.field_name, fd.field_id, fdd.default_type, default_value from tblIVFieldDefDate fdd join tblIVFieldDef fd on fd.field_id = fdd.field_id join tblLevel l on l.level_id = fd.level_id join tblModuleTranslation mt on l.module_id = mt.module_id and mt.is_default = 1 join tblFieldTranslation ft on ft.field_id = fd.field_id and ft.is_default = 1 where fdd.default_type=3
- After running the script, go to each field found and set a date value.
|