﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Required Fields Problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 06:05:57 GMT</lastBuildDate><ttl>20</ttl><item><title>Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10706.aspx</link><description>I've set some required fields on my BO.  When I go to test it, I don't get any broken rule messages. It prompts me to save the bo.  Here's what happens:&lt;br&gt;
&lt;br&gt;
1. I click new&lt;br&gt;
2. I click save (no data entered...should be some broken rules as many required fields aren't specified)&lt;br&gt;
3. I get prompted to Save changes, no broken rules&lt;br&gt;
&lt;br&gt;
In the BO, all I've done is setup my required fields.  Is there something else I need to do to get these fields validated (or could I have turned something off)?</description><pubDate>Fri, 24 Aug 2007 09:21:16 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost11048.aspx</link><description>Hehe, no problem :)&amp;nbsp; And I was on vacation, so you didn't get much help from me while I was gone...</description><pubDate>Fri, 24 Aug 2007 09:21:16 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost11029.aspx</link><description>I forgot to update this.  It was my bad (doh).  What has happening was that the BO was being saved by a navigation component (allowing the BO to be navigated using a listbox). That component was designed to handle the case when the user clicked on another item in the list without saving first. In that case it would prompt the use to save/undo the changes or cancel the navigation.  However, I wasn't checking on the broken rules here, so I'd get the prompt.  I added a check for broken rules and it is working.  I'd coded the component a while ago and forgot that I had that logic...oops  :blush:</description><pubDate>Thu, 23 Aug 2007 11:31:39 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10777.aspx</link><description>Here is the stack trace:&lt;br&gt;
&lt;br&gt;
	RamsBase.dll!FOXSystems.RAMS.Base.Navigation.ListBONavBase._dataBO_BusinessRulesChecked(MicroFour.StrataFrame.Business.BusinessRulesCheckedEventArgs e = {MicroFour.StrataFrame.Business.BusinessRulesCheckedEventArgs}) Line 584 + 0x5 bytes	Basic&lt;br&gt;
 	MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.raise_BusinessRulesChecked(MicroFour.StrataFrame.Business.BusinessRulesCheckedEventArgs e = {MicroFour.StrataFrame.Business.BusinessRulesCheckedEventArgs}) + 0x8f bytes&lt;br&gt;
 	MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.OnBusinessRulesChecked(MicroFour.StrataFrame.Business.BusinessRulesCheckedEventArgs e = {MicroFour.StrataFrame.Business.BusinessRulesCheckedEventArgs}) + 0x20 bytes&lt;br&gt;
 	MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.ShowBrokenRules(bool RaiseCheckedEvent = true) + 0x366 bytes&lt;br&gt;
 	MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.CheckRules(bool RaiseCheckedEvent = true) + 0x2a0 bytes&lt;br&gt;
 	MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.Save(bool Transactional = false, string TransactionKey = "") + 0xed bytes&lt;br&gt;
 	MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.Save() + 0x2a bytes&lt;br&gt;
 	RamsBase.dll!FOXSystems.RAMS.Base.Navigation.ListviewBONavManagerByToolStrip._saveControl_Click(Object sender = {System.Windows.Forms.ToolStripButton}, System.EventArgs e = {System.EventArgs}) Line 312 + 0x17 bytes	Basic&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.RaiseEvent(object key, System.EventArgs e) + 0x41 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ToolStripButton.OnClick(System.EventArgs e) + 0x3e bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.HandleClick(System.EventArgs e) + 0xc7 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.HandleMouseUp(System.Windows.Forms.MouseEventArgs e = {X = 21 Y = 19 Button = Left}) + 0x220 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.FireEventInteractive(System.EventArgs e, System.Windows.Forms.ToolStripItemEventType met) + 0x87 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.FireEvent(System.EventArgs e, System.Windows.Forms.ToolStripItemEventType met) + 0x122 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ToolStrip.OnMouseUp(System.Windows.Forms.MouseEventArgs mea) + 0xc7 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0xf2 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x56f bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) + 0x45 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.ToolStrip.WndProc(ref System.Windows.Forms.Message m = {msg=0x202 (WM_LBUTTONUP) hwnd=0x1130e wparam=0x0 lparam=0x14007b result=0x0}) + 0x71 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNative&amp;#119;indow.WndProc(ref System.Windows.Forms.Message m) + 0xd6 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Native&amp;#119;indow.Callback(System.IntPtr hWnd, int msg = 514, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes&lt;br&gt;
 	[Native to Managed Transition]&lt;br&gt;
 	user32.dll!7e418734()&lt;br&gt;
 	[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]&lt;br&gt;
 	user32.dll!7e418816()&lt;br&gt;
 	user32.dll!7e4189cd()&lt;br&gt;
 	user32.dll!7e418a10()&lt;br&gt;
 	[Managed to Native Transition]&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = -1, int pvLoopData = 0) + 0x2ea bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x17d bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes&lt;br&gt;
 	System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm) + 0x2e bytes&lt;br&gt;
 	MicroFour StrataFrame UI.dll!MicroFour.StrataFrame.Application.StrataFrameApplication.RunApplication() + 0x379 bytes&lt;br&gt;
 	RAMS.NET.exe!FOXSystems.RAMS.AppMain.Main() Line 28 + 0x6 bytes	Basic&lt;br&gt;
 	ntdll.dll!7c926abe()&lt;br&gt;
 	ntdll.dll!7c9268ad()&lt;br&gt;
 	ntdll.dll!7c91056d()&lt;br&gt;
 	kernel32.dll!7c80a027()&lt;br&gt;
 	ntdll.dll!7c91056d()&lt;br&gt;
 	ntdll.dll!7c926abe()&lt;br&gt;
 	ntdll.dll!7c9268ad()&lt;br&gt;
 	ntdll.dll!7c91056d()&lt;br&gt;
 	ntdll.dll!7c919bd3()&lt;br&gt;
 	ntdll.dll!7c910895()&lt;br&gt;
 	ntdll.dll!7c919a9c()&lt;br&gt;
 	ntdll.dll!7c919b3f()&lt;br&gt;
 	ntdll.dll!7c919aeb()&lt;br&gt;
 	ntdll.dll!7c919aeb()&lt;br&gt;
 	ntdll.dll!7c919ba0()&lt;br&gt;
 	kernel32.dll!7c80adde()&lt;br&gt;
 	kernel32.dll!7c80adf0()&lt;br&gt;
 	ntdll.dll!7c9106eb()&lt;br&gt;
 	ntdll.dll!7c9106eb()&lt;br&gt;
 	mscoree.dll!79004044()&lt;br&gt;
 	kernel32.dll!7c816fd7()&lt;br&gt;
 	ntdll.dll!7c9106eb()&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
The only code in the _dataBO_BusinessRulesChecked method is a "Stop" statement to get the stack trace.</description><pubDate>Wed, 08 Aug 2007 16:14:03 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10775.aspx</link><description>When you put a break point in the BusinessRules checked, can you copy the stack trace and post it here.&amp;nbsp; You can post the whole thing by either copying the value of System.Environment.StackTrace or opening the Stack Trace debugging window and right-clicking it to Select All and then right-clicking it to Copy.</description><pubDate>Wed, 08 Aug 2007 15:23:30 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10767.aspx</link><description>[quote]So, when you call Save() on the BO, you get the message asking you if you want to save changes?[/quote]&lt;br&gt;
Yes.&lt;br&gt;
&lt;br&gt;
[quote]That's odd...[/quote]&lt;br&gt;
:crazy:&lt;br&gt;
&lt;br&gt;
[quote]If you put a handler on the BO's AfterSave event, is it ever reached?[/quote]&lt;br&gt;
Yes. After I click no to saving the changes.&lt;br&gt;
&lt;br&gt;
[quote]And there's also a BusinessRulesChecked event on the BO that will be raised after the business rules have completed checking. You can check the count of the BrokenRules collection within that event to see if it added any broken rules from the required fields.[/quote]&lt;br&gt;
No broken rules. I also only get to this event after clicking on No to not save changes.</description><pubDate>Wed, 08 Aug 2007 13:35:18 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10759.aspx</link><description>So, when you call Save() on the BO, you get the message asking you if you want to save changes?&amp;nbsp; That's odd... that message should only be showing when you try to close the form.&amp;nbsp; If you put a handler on the BO's AfterSave event, is it ever reached?&amp;nbsp; And there's also a BusinessRulesChecked event on the BO that will be raised after the business rules have completed checking.&amp;nbsp; You can check the count of the BrokenRules collection within that event to see if it added any broken rules from the required fields.</description><pubDate>Wed, 08 Aug 2007 09:01:44 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10755.aspx</link><description>Actually, what happens is that I get prompted to save changes. If I say yes, then I again get prompted to save changes.  This goes on until I select no (don't save changes). The return is then Success {0}.  &lt;br&gt;
&lt;br&gt;
So, I'm probably not doing this correctly.  What else do I need to do when manually calling Save() on a BO?</description><pubDate>Tue, 07 Aug 2007 17:53:21 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10745.aspx</link><description>What is the return value of the Save() method when you call it on the BO?&amp;nbsp; Is it AbortedWithBrokenRules?</description><pubDate>Tue, 07 Aug 2007 09:17:00 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10736.aspx</link><description>Correction...&lt;br&gt;
[quote]If you put a debug in the CheckRulesOnCurrentRow does the RequiredFields collection have a count of zero?[/quote]&lt;br&gt;
No. There are three required fields in that collection (the same number I checked as being required)&lt;br&gt;</description><pubDate>Mon, 06 Aug 2007 15:09:34 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10735.aspx</link><description>[quote]Did the required fields get serialized (saved) to the source file?[/quote]&lt;br&gt;
yes. &lt;br&gt;
&lt;br&gt;
[quote]If you put a debug in the CheckRulesOnCurrentRow does the RequiredFields collection have a count of zero?[/quote]&lt;br&gt;
Yes. There are three required fields in that collection.&lt;br&gt;
&lt;br&gt;
The save is getting called by directly calling the Save method on the BO.  I tried calling the CheckRulesOnRow() method, but same behavior (just checked the rules twice).   Are the required fields checked before or after the CheckRulesOnRow event is raised?  Anything I might be doing wrong?&lt;br&gt;
&lt;br&gt;</description><pubDate>Mon, 06 Aug 2007 15:08:41 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Required Fields Problem</title><link>http://forum.strataframe.net/FindPost10709.aspx</link><description>Did the required fields get serialized (saved) to the source file?&amp;nbsp; There is really not much here.&amp;nbsp; If the RequiredFields collection has anything in it, they are checked within the BO when the save occurs.&amp;nbsp; If you put a debug in the CheckRulesOnCurrentRow does the RequiredFields collection have a count of zero?</description><pubDate>Fri, 03 Aug 2007 13:17:09 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>