Custom fields don't show up in addbrokenrule list


Author
Message
Marcel Heitlager
Marcel Heitlager
StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
Hi,



I have some custom fields in a business object that are used to process a credit card payment. The information isn't stored in database but does need to be validated, and then passed on to a processor.



They are all required fields, and if skipped the error pointer shows up on the form. But when I do custom validation under CheckRulesOnCurrentRow the error pointer won't show up on the form. And I can't select the field from the Addbrokenrule list either.



How can the form identify which field had the error so the error pointer shows up?



Thanks,



Marcel



P.S. -- as a side thought, is it possible to use your business objects with custom fields only? (Nothing stored to database) It seems to have problems with two-way binding, especially when the custom fields are validated, because it can't find the tablename. Just wondering since now I don't save data now, but later however might need to. Just tried to get out of setting up database right now.Blush
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I have created a sample that shows how to do this as it has come up a time or two in the past.  All you really need to do is call the AddBrokenRule method with the weak-typed call:

Me.AddBrokenRule("MyCustomField","This field requires entry.")

But I created a sample that shows how to implement this and properly setup the BO as though it were created through the BO Mapper.  You can get that sample here: http://forum.strataframe.net/FindPost15885.aspx 

as a side thought, is it possible to use your business objects with custom fields only? (Nothing stored to database) It seems to have problems with two-way binding, especially when the custom fields are validated, because it can't find the tablename. Just wondering since now I don't save data now, but later however might need to. Just tried to get out of setting up database right now

Absolutely.  There is no difference between a custom property that is created through the BO Mapper and stored data to the server versus a custom property that just stores to a variable.  The only time that you will have a two-way issue is if you do not setup the property descriptors or change the binding on the control to which it is being bound.  You will see in the above sample that I overwrote the GetCustomBindablePropertyDescriptors method and added the custom property as a ReflectionPropertyDescriptor there.  This ensures that the binding gets properly setup when binding.

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