I am having a problem while saving a BO that I created using the SF BOM (Business Object Mapper) which is based on a SQL2005 table that has a computed column in it.
I made that BO column/property ReadOnly in the BOM but if I make changes to any other column and then try to save that BO I get an error that I cannot update a computed column. This is not a calculated/computed column defined at the BO level it is defined as a computed column at the SQL table level. Which brings up two questions:
1] How do I handle SQL2005 computed columns defined at the table level in a BO.
2] How do I selectively pick columns from a table for a BO.
e.g. I have a few text columns with lots of data in them and so I don't want them to be a part of the BO.
It seems that right now the BOM only allows me to pick a table and not specific columns from within that table.
Thanks
Sarosh
As for your questions about the null value options, those are set on a per-field level within the BOMapper. You select the field you want to customize, and within the customization option, you use the null value options in the upper right of the customization dialog to set the options. Most data returned from the database is placed into .NET value types, which cannot have null values, so the BOMapper is forced to do some translations between those DBNull.Value values that get returned and the actual value that can be cast as a System.Int32 for example. Also, if you ever need to set a null value explicitly, and you don't have the null value options set on your BO field, you can do so using BO.CurrentRow("FieldName") = DBNull.Value.
If you want to set the null value options on more than one field at a time, you can use the customization wizard within the BOMapper.
Ben:
Will it be possible to add "ExcludeFromInsert" and "ExcludeFromUpdate" after the ReadOnly column in the BOM which in turn would fill the FieldsToExcludeFromUpdate and FieldsToExcludeFromInsert internally?
What about adding "IncludeInSelect" as well to handle the Selectively picking columns?