﻿<?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?)  » Messaging and Adding Broken Rules</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 29 May 2026 09:38:14 GMT</lastBuildDate><ttl>20</ttl><item><title>Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13633.aspx</link><description>I have decided to put my duplicate part number checking in the business object.&amp;nbsp; Well, that's where it belongs, anyway, right?&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; PartsBO_CheckRulesOnCurrentRow(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;CheckRulesEventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (IsDuplicatePartNumber())&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.AddBrokenRuleByKey(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.partnum, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"DuplicatePartNumber"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Boolean&lt;/FONT&gt;&lt;FONT size=2&gt; IsDuplicatePartNumber()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlCommand&lt;/FONT&gt;&lt;FONT size=2&gt; mCommand = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlCommand&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mCommand.CommandText = &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"SELECT COUNT(*) FROM PartsMaster WHERE partnum = @partnum AND partindex != @partindex"&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mCommand.Parameters.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlParameter&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@partnum"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlDbType&lt;/FONT&gt;&lt;FONT size=2&gt;.VarChar));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mCommand.Parameters.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlParameter&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@partindex"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlDbType&lt;/FONT&gt;&lt;FONT size=2&gt;.Int));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mCommand.Parameters[&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@partnum"&lt;/FONT&gt;&lt;FONT size=2&gt;].Value = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.partnum;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mCommand.Parameters[&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@partindex"&lt;/FONT&gt;&lt;FONT size=2&gt;].Value = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.partindex;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; ((&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;int&lt;/FONT&gt;&lt;FONT size=2&gt;)ExecuteScalar(mCommand) &amp;gt; 0);&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;The window will let me know that a rule is broken.&amp;nbsp; But it does not say which rule, which field, nor does my beautifully crafted message pop up.&amp;nbsp; How do I get the window to do two things:&amp;nbsp; 1)&amp;nbsp; Mark the field that is having the problem; and&amp;nbsp;2)&amp;nbsp; show my message.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Thanks!&lt;BR&gt;Bill&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Wed, 23 Jan 2008 09:21:33 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13673.aspx</link><description>[quote]I was tempted to say that I didn't know what you were talking about, but then I realized I don't have administrative priviledges to delete posts on the forum[/quote]&lt;/P&gt;&lt;P&gt;LOL...good thinking here...otherwise I might have been forced to find all of the links :D</description><pubDate>Wed, 23 Jan 2008 09:21:33 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13665.aspx</link><description>[quote][b]Greg McGuffey (01/22/2008)[/b][hr]Oh? And how is this is different from your normal dress? :blink: :w00t: ;)[/quote]&lt;P&gt;Well, usually I don't wear any... :P</description><pubDate>Wed, 23 Jan 2008 08:10:07 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13664.aspx</link><description>[quote][b]Trent L. Taylor (01/22/2008)[/b][hr]Yeah...but let's lay the foundation as of why...Ivan had offered to all attendees that I buy the beer...or something along those lines...isn't that right, Ivan? ;)[/quote]&lt;P&gt;Hum... I was tempted to say that I didn't know what you were talking about, but then I realized I don't have administrative priviledges to delete posts on the forum. :P</description><pubDate>Wed, 23 Jan 2008 08:06:48 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13659.aspx</link><description>[quote]Trent once...made me wear a chicken suit on one of his classes.[/quote]&lt;br&gt;
&lt;br&gt;
Oh?  And how is this is different from your normal dress? :blink: :w00t: ;)</description><pubDate>Tue, 22 Jan 2008 19:05:36 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13653.aspx</link><description>[quote]Trent once almost made me wear a chicken suit on one of his classes. How is that for an embarassing situation?[/quote]&lt;/P&gt;&lt;P&gt;Yeah...but let's lay the foundation as of why...Ivan had offered to all attendees that I buy the beer...or something along those lines...isn't that right, Ivan? ;)</description><pubDate>Tue, 22 Jan 2008 17:05:42 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13647.aspx</link><description>Nothing to feel embarassed at all. I'm really glad it worked for you. &lt;P&gt;Trent once almost made me wear a chicken suit on one of his classes. How is that for an embarassing situation? :D</description><pubDate>Tue, 22 Jan 2008 16:03:54 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13646.aspx</link><description>Uh...that was it...:blush:&lt;/P&gt;&lt;P&gt;Embarassing.&lt;/P&gt;&lt;P&gt;Hey...at least, I am learning!&amp;nbsp; :w00t: :w00t: :w00t:</description><pubDate>Tue, 22 Jan 2008 15:55:06 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13644.aspx</link><description>Hi Bill.&lt;P&gt;I'm glad it is working, you are welcome. :cool:&lt;P&gt;Regarding the message, I think you should be passing a "Text values" key, not a &lt;BR&gt;"Messages key" from your Messaging&amp;nbsp;Project. Is that the case?</description><pubDate>Tue, 22 Jan 2008 15:49:05 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13643.aspx</link><description>Great!&amp;nbsp; That helps for part one.&amp;nbsp; Now, how do I get the window to recognize the localization message involved?&amp;nbsp; It has the alert icon next to the field now, which alerts the user.&amp;nbsp; The tooltip looks like it is trying to present my custom message, but it is filled with some coding that will scare the average user.&lt;/P&gt;&lt;P&gt;Thanks, again, Ivan!&amp;nbsp; You are a big help!&lt;BR&gt;Bill</description><pubDate>Tue, 22 Jan 2008 15:40:37 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Messaging and Adding Broken Rules</title><link>http://forum.strataframe.net/FindPost13642.aspx</link><description>Hi Bill.&lt;/P&gt;&lt;P&gt;On this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.AddBrokenRuleByKey(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.partnum, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"DuplicatePartNumber"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.AddBrokenRuleByKey(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;PartsBOFieldNames&lt;/FONT&gt;&lt;FONT size=2&gt;.partnum, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"DuplicatePartNumber"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.</description><pubDate>Tue, 22 Jan 2008 15:33:54 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>