StrataFrame Forum

Unique index and BrokenRules

http://forum.strataframe.net/Topic22806.aspx

By Jiri Brazda - 4/20/2009

Hi,

I have Unique index on some fields in tables and now I would need to inform user that he has entered duplicated value. At the moment I'm solving this problem bz calling my methods such "...IsUnique" and manually adding information about duplicity to BrokenRules collection to be handled later.

The question is simple - is it possible to force BrokenRules to handle Unique indexes?

Thank You

Jiri Brazda

By Greg McGuffey - 4/20/2009

I've done a couple of things to handle unique index issues, the best being to handle it in the CheckRulesOnCurrentRow event handler of the BO.



In the event handler, I call another method to check if the data would violate the unique index, usually a sproc. If the data would violate the unique index, I then setup broken rules for the fields the user can change to fix the issue.



Hope that helps! BigGrin
By Jiri Brazda - 4/21/2009

Yes I'm using similar approach. I just wanted to ask whether SF can handle Unique key rules somehow automatically - just like it does with required fields - to avoid wasting time when some solution already exists...

Thank You for reply Smile

By Trent L. Taylor - 4/21/2009

This is something that is actually on the list for a future update.  We added this to our BaseBO in our medical software and we will most likely incorporate this into the framework once it has been throughly tested.
By Jiri Brazda - 4/21/2009

Great info! I'm looking forward to next versions Smile

Thanks