StrataFrame Forum

How do I override a field property in a business object?

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

By Cory Cookson - 11/7/2008

I would like to override a field property in an SF business object so that I can effect changes to the data before it is saved back to the database.

I tried copying out the field property generated from the business object mapping tool, placing it in the business object partial class where you add data retreival methods so it wouldn't be overwritten if the object is regend and applying the new and override key words but it tells me that it is already in use in the object (which it is of course, I just want to override it)

Any help you can offer me woould be greatly appreciated.

Thanks,

Cory

By Greg McGuffey - 11/7/2008

You might just want to provide your own custom code for any properties like this. In the BO Mapper, for the properties that you need to do something custom, check the "custom code" check box. Then put your custom code into the text box that is on the Custom Code tab (which appears when you click custom code).



I'd just copy in the existing property code (or your already customized code...without overrides key words). This way, when you rebuild the BO, you're custom code just gets inserted in the designer file. BigGrin
By Cory Cookson - 11/7/2008

Excellent answer!  Looks like this will work for me.

Thanks for the quick response!

By Greg McGuffey - 11/7/2008

Glad it helped! BigGrin