StrataFrame Forum

Business Object's FieldNames Enumeration v. Custom Field Properties

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

By Alex Luyando - 5/28/2009

Hi all -



I have a few Custom Field Properties, and am using a single FieldPropertyChanged() event. I wanted to test the incoming e parameter with something like...





if (e.FieldChanged == boITransactions.boITransactionsFieldNames.Override_Flag)

....





It's looking to me, however, like CFPs are not part of the enumerated business object fields? Is that correct?



TIA
By Edhy Rijo - 5/28/2009

Hi Alex,

Custom Field Properties can not be part of the BO.FieldNames enumerations because the BOM does not know anything about them, all this is hard coded by the BOM in the bo.designer file.



Now can you explain in more detail what do you want to accomplish?



In my case CFPs are read only and therefor will not trigger any Changed event, what is the purpose of your CFPs?
By Trent L. Taylor - 6/1/2009

Edhy is correct in that they will not be part of that event as they are, as you mentioned, custom. So the BO in this regard doesn't reflect over any CFPs (as this would be slow). So you are better off creating a single method that you call or even raise the event your self as these events are created on the BO. Most likely you will just want to create another method to funnel all calls through.



For example, in the Set of the CFP, you would call your custom method / event. This is ultimately all that the field events do.
By Alex Luyando - 6/1/2009

Thanks Edhy and Trent (and sorry I didn't reply earlier to your reply, Edhy).



I am using a single event to handle field changes, and need to test if the event was raised by changes to any of several business object fields in order to call/not call a method for additional data processing.



Most of the fields I am testing are fields created by the BOM so I test using the FieldName. enumerations v. e.FieldChanged. For the two Custom Field Properties I need to hard-code the test for the CFPs' fieldnames (not a biggie) and use the CFPs' SET( ) to trigger the call to the same method that the FieldChanged( ) handles for the BOM fields. It just means for two paths for maintenance if column/field names are changed in the future--one for BOM fields, another for CFPs. Don't love it, but it's ain't the worse thing I've seen.



Overall it's all good!

________________

_____/ Regards,

____/ al