| | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 10:21:24 AM Posts: 473, Visits: 1,942 |
| | I have decided to put my duplicate part number checking in the business object. Well, that's where it belongs, anyway, right? Here is my code: private void PartsBO_CheckRulesOnCurrentRow(CheckRulesEventArgs e) { if (IsDuplicatePartNumber()) { this.AddBrokenRuleByKey(this.partnum, "DuplicatePartNumber"); } }private Boolean IsDuplicatePartNumber() { SqlCommand mCommand = new SqlCommand(); mCommand.CommandText = "SELECT COUNT(*) FROM PartsMaster WHERE partnum = @partnum AND partindex != @partindex"; mCommand.Parameters.Add(new SqlParameter("@partnum", SqlDbType.VarChar)); mCommand.Parameters.Add(new SqlParameter("@partindex", SqlDbType.Int)); mCommand.Parameters["@partnum"].Value = this.partnum; mCommand.Parameters["@partindex"].Value = this.partindex; return ((int)ExecuteScalar(mCommand) > 0); }The window will let me know that a rule is broken. But it does not say which rule, which field, nor does my beautifully crafted message pop up. How do I get the window to do two things: 1) Mark the field that is having the problem; and 2) show my message. Thanks! Bill |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 11:01:38 AM Posts: 793, Visits: 11,574 |
| | Hi Bill. On this line: this.AddBrokenRuleByKey(this.partnum, "DuplicatePartNumber"); try this: this.AddBrokenRuleByKey(PartsBOFieldNames.partnum, "DuplicatePartNumber"); Hope it helps. |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 10:21:24 AM Posts: 473, Visits: 1,942 |
| | Great! That helps for part one. Now, how do I get the window to recognize the localization message involved? It has the alert icon next to the field now, which alerts the user. 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. Thanks, again, Ivan! You are a big help! Bill |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 11:01:38 AM Posts: 793, Visits: 11,574 |
| | Hi Bill. I'm glad it is working, you are welcome.  Regarding the message, I think you should be passing a "Text values" key, not a "Messages key" from your Messaging Project. Is that the case? |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 10:21:24 AM Posts: 473, Visits: 1,942 |
| | | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 11:01:38 AM Posts: 793, Visits: 11,574 |
| | Nothing to feel embarassed at all. I'm really glad it worked for you. Trent once almost made me wear a chicken suit on one of his classes. How is that for an embarassing situation? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 9:52:47 AM Posts: 4,770, Visits: 4,732 |
| Trent once almost made me wear a chicken suit on one of his classes. How is that for an embarassing situation? 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? |
| | | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: Yesterday @ 10:03:03 PM Posts: 1,322, Visits: 3,439 |
| | | | | | |
|