Save on ComboBox field gives Broken Rule Error


Author
Message
lastcanary
lastcanary
StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
Hi,

We are working with combobox control and trying to use it in our application. We found that if a field is a required field and it is connected to a Business Object through a combobox control even if the combobox is filled with a value it is giving a broken rule error while saving.

I am sending you an example in the Strataflix application. If you check the movie maintenance form (MovieMaintenance.cs) I substitiued the Movie field from a textbox to a combobox. I populated the combobox from PeopleBO by adding FillTop100 Method to this BO. When you select something for the comboboxbox and fill the rest and click the save button it gives a broken rule error.

Could you please help us to fix this error?

Best Regards
Attachments
CSharp.zip (75 views, 1.00 MB)
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

Well, you are getting the broken rule error because the rule of not having the mv_Title is really broken w00t.

In your new combobox the BindingField mv_Title is not being filled by the combobox population method, if you double check it, the Value Member being used is pl_pk from the PeopleBO and that is the value used to fill the BindingField mv_Title which are different.

Can you please explain, what is it that you want to accomplish?

Edhy Rijo

lastcanary
lastcanary
StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
We were just trying to use combobox for our form. We are simply tring to get a string in the combobox. We changed the pl_pk to pl_FullName since it is a string field, but the broken rule still exists.

Could you please fix the code and send us the corrected source code?

Thanks

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Instead of fixing it, I rather you learn from it.

In this particular case, the business object MoviesBO.cs has the mv_Title as part of its Required Fields collection.  If that is not what you want, simply open the BO and uncheck the mv_Tile from the Required Fields Editor and then the form will save without a broken rule.

Take a look in the help file at the Required Fields and they can be useful for your own logic.

Edhy Rijo

lastcanary
lastcanary
StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
We already know that mv_Title is set as a required field. We are selecting a string for the combobox so mv_Title is not empty, why are we getting the broken rule then?

We want to have a field that is a required field but can also be set from a combobox, is this not possible?
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Ok, if that is the case, then change the BindingProperty of the combobox to SelectedValue.  That should do the trick since comboboxes use the SelectedValue for binding.

By the way, what is your name?

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search