Not able to put validation on field on page level in mendix studio pro

0
Hi All, There is a requirement in our application, in which we need to show error message on a field on the page level. For that particular field on the page, when I have selected Custom inside Validation option and put some custom validation rule and saved it. After that I am getting the following error in studio pro :    System.InvalidOperationException: Sequence contains no matching element   at System.Linq.ThrowHelper.ThrowNoMatchException()   at Mendix.Modeler.WebUI.View.Forms.MemberWidgets.WidgetValidationFormPart.<>c__DisplayClass4_0.<CollectControls>b__1() in Mendix.Modeler.WebUI.View\Forms\MemberWidgets\WidgetValidationFormPart.cs:line 37   at Mendix.Modeler.UIFramework.Properties.PropertyInfo`1.GetValue() in Mendix.Modeler.UIFramework\Properties\PropertyInfo.cs:line 26   at Mendix.Modeler.Core.View.ToolWindows.PropertiesPropertyChoiceViewModel..ctor(IPropertyContext propertyContext) in Mendix.Modeler.Core.View\ToolWindows\Properties\PropertiesPropertyChoiceViewModel.cs:line 38   at Mendix.Modeler.Core.View.ToolWindows.PropertyViewModelFactory.CreatePropertyViewModel(IPropertyContext context) in Mendix.Modeler.Core.View\ToolWindows\Properties\PropertyViewModelFactory.cs:line 48   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToList()   at Mendix.Modeler.Core.View.ToolWindows.PropertyViewModelFactory.CreateViewModels(IPropertyCollection propertyCollection) in Mendix.Modeler.Core.View\ToolWindows\Properties\PropertyViewModelFactory.cs:line 30   at Mendix.Modeler.Core.View.ToolWindows.PropertiesViewModel.<>c__DisplayClass41_0.<UpdateAsync>g__UpdateTabViewModels|0() in Mendix.Modeler.Core.View\ToolWindows\Properties\PropertiesViewModel.cs:line 202   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)--- End of stack trace from previous location ---   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)--- End of stack trace from previous location ---   at Mendix.Modeler.Core.View.ToolWindows.PropertiesViewModel.UpdateAsync() in Mendix.Modeler.Core.View\ToolWindows\Properties\PropertiesViewModel.cs:line 251   at Mendix.Modeler.Core.View.ToolWindows.PropertiesViewModel.OnSelectedObjectChangedAsync() in Mendix.Modeler.Core.View\ToolWindows\Properties\PropertiesViewModel.cs:line 163   at Mendix.Modeler.Core.View.ToolWindows.PropertiesViewModel.<.ctor>b__35_0() in Mendix.Modeler.Core.View\ToolWindows\Properties\PropertiesViewModel.cs:line 108   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
asked
1 answers
1

Hi Trishla,

Using page level validation is not recommended and it is not considered a good practice, bcz it can abort nanoflows/microflows that are used on the page and it can cause trouble in functionalities. Instead you can use validation microflows for the same functionality.

Hope it helps!

Rishabh

(Resilient It Services)

answered